不用管它編碼是什麼~~不會再到看亂碼啦
function xmlHttp(URL,www_responseText)
On Error Resume Next
xmlHttp = False
Set objHTTP = CreateObject("microsoft.XMLHTTP")
objHTTP.open "GET", URL, False
objHTTP.send
www_status = objHTTP.status
www_statusText = objHTTP.statusText
www_responseText = bytes2BSTR(objHTTP.responseBody)
Set objHTTP = Nothing
if Err.number <> 0 then
www_responseText = Err.Description
exit function
end if
if www_status = "200" then
xmlHttp = True
else
end if
end function
Function bytes2BSTR(vIn)
strReturn = ""
For i = 1 To LenB(vIn)
ThisCharCode = AscB(MidB(vIn,i,1))
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
Next
bytes2BSTR = strReturn
End Function
Function BytesToBstr(body)
dim objstream
set objstream = Server.CreateObject("adodb.stream")
objstream.Type = 1
objstream.Mode =3
objstream.Open
objstream.Write body
objstream.Position = 0
objstream.Type = 2
objstream.Charset = "BIG-5"
BytesToBstr = objstream.ReadText
objstream.Close
set objstream = nothing
End Function