A questinon about how to use WinHttp.dll

F

flyingchen

The problem is about the new version of the WinHttp.dll.
My Code like this :

public string Do(string Method,string Url,Object Async)
{
WinHttpRequest winHttpReq = new
WinHttp.WinHttpRequestClass();

winHttpReq.OnResponseStart += new
IWinHttpRequestEvents_OnResponseStartEventHandler(winHttpReq_OnResponseStart);
winHttpReq.OnResponseFinished += new
IWinHttpRequestEvents_OnResponseFinishedEventHandler(winHttpReq_OnResponseFinished);

try
{
winHttpReq.Open(Method, Url, Async);
}
catch (Exception)
{
throw;
}

winHttpReq.Send(null);

return winHttpReq.ResponseText;
}

void winHttpReq_OnResponseFinished()
{
// to do sth
}

void winHttpReq_OnResponseStart(int Status, string
ContentType)
{
// to do sth
}

The problem can build and run ,but the two events of the
WinHttpRequestClass can not run anytime. But it's very important to
me . Help!
Thanks a lot !
 
M

Mark Rae

There's a problem with your newsreader, which is causing it to repeat your
posts...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,904
Latest member
HealthyVisionsCBDPrice

Latest Threads

Top