我在VB6中使用了WebRequest,并且将超时设置为“ 5000”(5秒),但是即使在5秒后仍未超时,我们将不胜感激。

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.SetTimeouts之前设置objWinHTTP.Open

和您为objWinHTTP.SetTimeouts设置的四个参数是

Resolve, Connect, Send and Receive


因此,应根据该值设置每个值。

10-04 18:36