再次提问有关XMLHTTP的问题,以前的帖子看了可惜还没解决
我看了很多XMLHTTP的帖子,也看了不少关于解决乱码的解决方法,可是我现在实在是搞不定了,
<%
Function bytes2BSTR(vIn)
Dim strReturn,i,ThisCharCode,innerCode,Hight8,Low8,NextCharCode
strReturn = ""
For i = 1 To LenB(vIn)
ThisCharCode = AscB(MidB(vIn,i,1))
Response.Write ThisCharCode
If ThisCharCode < &H80 Then
strReturn = strReturn & Chr(ThisCharCode)
Else
NextCharCode = AscB(MidB(vIn,i+1,1))
strReturn = strReturn & Chr(CLng(ThisCharCode) * &H100 + CInt(NextCharCode))
i = i + 1
End If
Response.Write strReturn
Response.Write "<br>"
Next
bytes2BSTR = strReturn
End Function
on error resume next
dim xmlHttp
set xmlHttp=server.CreateObject("Microsoft.xmlHttp")
strUrl="http://www.hzqx.com/gzhfw/index.asp"
Response.Write strUrl
xmlHttp.open "post",strUrl,false
xmlHttp.SetRequestHeader "content-Type","text/xml;charset=gb2312"
xmlHttp.send
Response.CharSet="Gb2312"
'Response.ContentType="test/xml"
a=xmlHttp.responseText
b="var y="""
c="document.write(y);"
a1=InStr(1,a,b)
a2=InStr(1,a,c)
r=Mid(a,a1,a2-a1)
Response.Write bytes2BSTR(r)&"<br>"
%>
进行了多次尝试都不成功,请高手指教。