av网站免费线看精品_国产做a爱视频免费不_深爱激情网开心五月天_伊人五月天在线视频网

 
Xml Http抓取數(shù)據(jù)時亂碼問題解決
發(fā)布時間:2008-04-25   瀏覽次數(shù):1227455

Xml Http抓取數(shù)據(jù)時亂碼問題解決

內(nèi)碼問題.用這段代碼的吧,我已經(jīng)改得很精簡了.

使用XMLHTTP抓取地址并進(jìn)次內(nèi)容處理

以下為引用的內(nèi)容:
Function GetBody(Url)
Dim objXML
On Error Resume Next
Set objXML = CreateObject("Microsoft.XMLHTTP")
With objXML
.Open "Get", Url, False, "", ""
.Send
GetBody = .ResponseBody
End With
GetBody=BytesToBstr(GetBody,"GB2312")
Set objXML = Nothing
End Function

使用Adodb.Stream處理二進(jìn)制數(shù)據(jù)

以下為引用的內(nèi)容:
Function BytesToBstr(strBody,CodeBase)
dim objStream
set objStream = Server.CreateObject("Adodb.Stream")
objStream.Type = 1
objStream.Mode =3
objStream.Open
objStream.Write strBody
objStream.Position = 0
objStream.Type = 2
objStream.Charset = CodeBase
BytesToBstr = objStream.ReadText
objStream.Close
set objStream = nothing
End Function

立即預(yù)約