我在VB6中使用WebRequest并且我将超时设置为“5000”(5秒),但即使在5秒后它也没有超时,任何帮助都表示赞赏. x:Dim objWinHTTPSet objWinHTTP = CreateObject("WinHttp.WinHttpRequest.5.1") objWinHTTP.Open "POST", "
x: Dim objWinHTTP Set objWinHTTP = CreateObject("WinHttp.WinHttpRequest.5.1") objWinHTTP.Open "POST", "http://twitter.com/" & TwitterUSERNAME objWinHTTP.SetTimeouts 5000, 5000, 5000, 5000 Call objWinHTTP.Send(psData) MsgBox (objWinHTTP.Status) If objWinHTTP.Status <> 200 Then Timer.Enabled = False MsgBox ("D:") GoTo x End If你应该在objWinHTTP.Open之前设置objWinHTTP.SetTimeouts
以及为objWinHTTP.SetTimeouts设置的四个参数是
Resolve, Connect, Send and Receive
所以每个值都应该根据它来设置.