<%
On Error Resume Next
Response.Write "<h3>服务XmlHttp组件支持情况:</h3>"
oxml=array
("Msxml2.ServerXMLHTTP.6.0","Msxml2.ServerXMLHTTP.5.0","Msxml2.ServerXMLHTTP.4.0","Msxml2.ServerXMLHTTP.3.0","Msxml2.ServerXMLHTTP","Msxml2.XMLHTTP.6.0","Msxml2.XMLHTTP.5.0","Msxml2.XMLHTTP.4.0","Msxml2.XMLHTTP.3.0","Msxml2.XMLHTTP")
for i=0 to ubound(oxml)
Set getxmlhttp = Server.CreateObject(oxml(i))
If Err Then
Err.Clear
Response.Write oxml(i)&"不支持<br/>"
else
Response.Write oxml(i)&" 支持<br/>"
end if
next
%>
是否支持XmlHttp组件的判断
本文通过VBScript演示了如何检查服务器环境中多种版本的XMLHttp组件是否被支持。这些组件包括Msxml2.ServerXMLHTTP的不同版本及Msxml2.XMLHTTP系列。通过对每个组件尝试创建对象并捕获错误的方式,可以确定哪些版本的XMLHttp组件可用。

被折叠的 条评论
为什么被折叠?



