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.`
on xHttp.Send
答案 0 :(得分:1)
我最近遇到了类似的问题,试图通过https将文件检索到Windows 2003服务器上。结果证明问题是客户端支持的SSL / TLS密码集太旧了,服务器上都没有支持这些密码。
就我而言,服务器是AWS ELB的后面,它正在进行https协商。我能够重新配置ELB以使用较旧的密码集(在' Listeners'选项卡中,将密码配置更改为使用ELBSecurityPolicy-2015-05),客户端脚本神奇地开始工作。
答案 1 :(得分:1)
我们必须在Windows 2003服务器中安装以下KB:
https://support.microsoft.com/en-us/kb/948963
此后,另一个错误:
msxml3.dll错误' 80072f7d'
安全通道支持
发生错误感谢这篇帖子(server giving msxml3.dll error '80072f7d' when trying to access secure url)安装了http://support.microsoft.com/kb/938397并且工作了。
当应用于生产时,只有第一个KB解决了问题。
答案 2 :(得分:0)
如果您将 MSXML2.ServerXMLHTTP更改为MSXML2.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"