富贵资源网 Design By www.hznty.com
用ADODB.Stream转换,用streamtochar这个函数
<HTML>
<html>
<head>
<META http-equiv="Content-Type" content="text/html; charset=Big5">
<title>test</title>
<SCRIPT LANGUAGE="JavaScript">
<!--
window.onerror = function (err) {
return false;
};
//-->
</SCRIPT>
<script language="vbscript">
<!--
'获取地址
dim sUrl
sUrl="http://www.aastocks.com/chi/Login/Login.asp"
Function streamtochar(StrStream)
set stream=CreateObject("ADODB.Stream")
stream.type=1
stream.Mode=3
stream.Open
stream.Write Strstream
stream.Position= 0
stream.Type= 2
stream.Charset="BIG5"
streamtochar= stream.ReadText
stream.Close
set stream=nothing
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 getContentByUrl(url)
'建立对象
set oXmlHttp = CreateObject("MSXML2.XMLHTTP")
oXmlHttp.open "GET",url,false
oXmlHttp.send
getContentByUrl = streamtochar(oXmlHttp.responseBody)
set oXmlHttp=nothing
end function
'函数,获得网站内容
function getRealContent(url)
sContent = getContentByUrl(url)
getRealContent=sContent
end function
'-->
</script>
</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<SCRIPT LANGUAGE=vbscript>
<!--
str=getRealContent(sUrl)
'document.write "<xmp>"&str &"</xmp>"
'document.write str
document.write "<META http-equiv=""Content-Type"" content=""text/html; charset=Big5"">"&str
'-->
</SCRIPT>
</BODY>
</HTML>
<HTML>
<html>
<head>
<META http-equiv="Content-Type" content="text/html; charset=Big5">
<title>test</title>
<SCRIPT LANGUAGE="JavaScript">
<!--
window.onerror = function (err) {
return false;
};
//-->
</SCRIPT>
<script language="vbscript">
<!--
'获取地址
dim sUrl
sUrl="http://www.aastocks.com/chi/Login/Login.asp"
Function streamtochar(StrStream)
set stream=CreateObject("ADODB.Stream")
stream.type=1
stream.Mode=3
stream.Open
stream.Write Strstream
stream.Position= 0
stream.Type= 2
stream.Charset="BIG5"
streamtochar= stream.ReadText
stream.Close
set stream=nothing
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 getContentByUrl(url)
'建立对象
set oXmlHttp = CreateObject("MSXML2.XMLHTTP")
oXmlHttp.open "GET",url,false
oXmlHttp.send
getContentByUrl = streamtochar(oXmlHttp.responseBody)
set oXmlHttp=nothing
end function
'函数,获得网站内容
function getRealContent(url)
sContent = getContentByUrl(url)
getRealContent=sContent
end function
'-->
</script>
</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<SCRIPT LANGUAGE=vbscript>
<!--
str=getRealContent(sUrl)
'document.write "<xmp>"&str &"</xmp>"
'document.write str
document.write "<META http-equiv=""Content-Type"" content=""text/html; charset=Big5"">"&str
'-->
</SCRIPT>
</BODY>
</HTML>
富贵资源网 Design By www.hznty.com
广告合作:本站广告合作请联系QQ:858582 申请时备注:广告合作(否则不回)
免责声明:本站资源来自互联网收集,仅供用于学习和交流,请遵循相关法律法规,本站一切资源不代表本站立场,如有侵权、后门、不妥请联系本站删除!
免责声明:本站资源来自互联网收集,仅供用于学习和交流,请遵循相关法律法规,本站一切资源不代表本站立场,如有侵权、后门、不妥请联系本站删除!
富贵资源网 Design By www.hznty.com
暂无评论...