URL = "https://github.com/index.html"
Set xHttp = CreateObject("MSXML2.ServerXMLHTTP")
xHttp.Open "GET", URL, False
xHttp.setOption 2, 13056
xHttp.Send()
任何人都可以说,为什么此代码在Windows7上起作用,并且在Windows XP
上不起作用错误
msxml3.dll error '80090326' `
The message received was unexpected or badly formatted.`
在xHttp.Send
我最近遇到了一个类似的问题,试图通过HTTPS检索文件上的文件2003服务器。事实证明,问题是客户端支持的SSL/TLS密码的集合是如此旧,以至于服务器上没有支持它们。
就我而言,服务器是在进行HTTPS谈判的AWS ELB背后。我能够重新配置ELB以使用旧的密码集(在"侦听器"选项卡中,更改密码配置以使用ElbSecurityPolicy-2015-05),并且客户端脚本神奇地开始工作。
<</p> <</p> <</p> <</p>我们必须在Windows 2003服务器中安装以下KB:
https://support.microsoft.com/en-us/kb/948963
此后,另一个错误:
msxml3.dll错误'80072f7d'
安全通道支持中发生了错误
感谢这篇文章(尝试访问安全URL时的服务器给予MSXML3.dll错误'80072f7d')安装了http://support.microsoft.com/kb/938397并工作。
在生产时,只有第一个KB解决了问题。
如果将 msxml2.serverxmlhttp更改为msxml2.xml.2.xmlhttp或microsoft.xmlhttp 它是否对您有用?
尝试使用此代码,并告诉我们您是否遇到相同的错误(仅在Windows 7上测试)
On Error Resume Next
Set File = WScript.CreateObject("MSXML2.XMLHTTP")
File.Open "GET", "https://github.com/index.html", False
'This is IE 8 headers
File.setRequestHeader "User-Agent", "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; .NET CLR 1.1.4322; .NET CLR 3.5.30729; .NET CLR 3.0.30618; .NET4.0C; .NET4.0E; BCD2000; BCD2000)"
File.Send
If err.number <> 0 then
line =""
Line = Line & vbcrlf & ""
Line = Line & vbcrlf & "Error getting file"
Line = Line & vbcrlf & "=================="
Line = Line & vbcrlf & ""
Line = Line & vbcrlf & "Error " & err.number & "(0x" & hex(err.number) & ") " & err.description
Line = Line & vbcrlf & "Source " & err.source
Line = Line & vbcrlf & ""
Line = Line & vbcrlf & "HTTP Error " & File.Status & " " & File.StatusText
Line = Line & vbcrlf & File.getAllResponseHeaders
wscript.echo Line
Err.clear
wscript.quit
End If
On Error Goto 0
Set BS = CreateObject("ADODB.Stream")
Set ws = CreateObject("wscript.Shell")
BS.type = 1
BS.open
BS.Write File.ResponseBody
BS.SaveToFile "Location.html", 2
ws.run "Location.html"