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 !
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 !