1
我想发送一个HTTP获取到一个内部网络服务器,这工作正常,除非由于重新路由的原因,用户必须遍历代理才能访问网络服务器,然后我只是得到一个WinInet 12029错误“ERROR_INTERNET_CANNOT_CONNECT尝试连接到服务器失败。”请你能帮我拉现有的Internet选项代理配置?我不想静态定义代理凭证(我也没有尝试过)。Vbscript获取WinINET API的代理配置
我的代码:
Function HTTPGet1
Dim o, URL, stat
URL = myURL
On Error Resume Next
Set o = CreateObject("Microsoft.XMLHTTP")
' If Err.Number <> 0 Then
'msgbox err.Number & err.Description
'msgbox "cake"
'Exit Function
' End if
o.WinHttpGetIEProxyConfigForCurrentUser
o.open "GET", URL, False
o.send
stat = o.Status 'CInt(o.Status)
if stat = "200" then
msgbox "Account created successfully."
elseif stat = "" then
msgbox "Connection attempt failed due to: " & err.description & "."
err.clear
else
msgbox "HTTP error code " & stat & " received."
end if
end function
感谢您的时间!