国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 開發 > JS > 正文

用ADODB.Stream轉換

2024-09-06 12:43:42
字體:
來源:轉載
供稿:網友
用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>
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 利川市| 新宁县| 香格里拉县| 泸州市| 清水河县| 莒南县| 金湖县| 宝应县| 维西| 治多县| 株洲县| 阿拉善右旗| 孝昌县| 广安市| 同心县| 曲周县| 泾源县| 沙洋县| 内黄县| 盘锦市| 师宗县| 伊川县| 满洲里市| 外汇| 邵东县| 台山市| 卓资县| 镇平县| 且末县| 桃园县| 太仓市| 海兴县| 库伦旗| 民和| 通海县| 运城市| 荃湾区| 吉水县| 佛学| 彭水| 抚顺市|