进击的巨人图标:Microsoft.XMLHTTP出现乱码怎么办!!

来源:百度文库 编辑:查人人中国名人网 时间:2024/04/27 17:09:12
Microsoft.XMLHTTP出现乱码怎么办
以下是我的源代码,在加什么才可以正常显示?

<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<%
Dim objXMLHTTP, xml
Set xml = Server.CreateObject("Microsoft.XMLHTTP")

xml.Open "GET", "http://www.baidu.com/index.html", False
' Pull the data from the web page
xml.Send

Response.Write xml.responseText

Set xml = Nothing
%>

<%
Function bytes2BSTR(arrBytes)
strReturn = ""
arrBytes = CStr(arrBytes)
For i = 1 To LenB(arrBytes)
ThisCharCode = AscB(MidB(arrBytes, i, 1))
If ThisCharCode < &H80 Then
strReturn = strReturn & Chr(ThisCharCode)
Else
NextCharCode = AscB(MidB(arrBytes, i+1, 1))
strReturn = strReturn & Chr(CLng(ThisCharCode) * &H100 + CInt(NextCharCode))
i = i + 1
End If
Next
bytes2BSTR = strReturn
End Function

Dim objXMLHTTP, xml
Set xml = Server.CreateObject("Microsoft.XMLHTTP")

xml.Open "GET", "http://www.baidu.com/index.html", False
xml.Send

Response.Write bytes2BSTR(xml.responseBody)

Set xml = Nothing
%>