用ADODB.Stream转换,用streamtochar这个函数
<HTML>
<html>
<head>
<METAhttp-equiv="Content-Type"content="text/html;charset=Big5">
<title>test</title>
<SCRIPTLANGUAGE="JavaScript">
<!--
window.onerror=function(err){
returnfalse;
};
//-->
</SCRIPT>
<scriptlanguage="vbscript">
<!--
'获取地址
dimsUrl
sUrl="http:///chi/Login/Login.asp"
Functionstreamtochar(StrStream)
setstream=CreateObject("ADODB.Stream")
stream.type=1
stream.Mode=3
stream.Open
stream.WriteStrstream
stream.Position=0
stream.Type=2
stream.Charset="BIG5"
streamtochar=stream.ReadText
stream.Close
setstream=nothing
EndFunction
'Functionbytes2BSTR(vIn)
'strReturn=""
'Fori=1ToLenB(vIn)
'ThisCharCode=AscB(MidB(vIn,i,1))
'IfThisCharCode<&H80Then
'strReturn=strReturn&Chr(ThisCharCode)
'Else
'NextCharCode=AscB(MidB(vIn,i+1,1))
'strReturn=strReturn&Chr(CLng(ThisCharCode)*&H100+CInt(NextCharCode))
i=i+1
'EndIf
'Next
'bytes2BSTR=strReturn
'EndFunction
'函数,得到内容
functiongetContentByUrl(url)
'建立对象
setoXmlHttp=CreateObject("MSXML2.XMLHTTP")
oXmlHttp.open"GET",url,false
oXmlHttp.send
getContentByUrl=streamtochar(oXmlHttp.responseBody)
setoXmlHttp=nothing
endfunction
'函数,获得网站内容
functiongetRealContent(url)
sContent=getContentByUrl(url)
getRealContent=sContent
endfunction
'-->
</script>
</head>
<bodyleftmargin="0"topmargin="0"marginwidth="0"marginheight="0">
<SCRIPTLANGUAGE=vbscript>
<!--
str=getRealContent(sUrl)
'document.write"<xmp>"&str&"</xmp>"
'document.writestr
document.write"<METAhttp-equiv=""Content-Type""content=""text/html;charset=Big5"">"&str
'-->
</SCRIPT>
</BODY>
</HTML>
