%
''''''''''''''''斷劍注釋'''''''''''''''''''''''''
''''strText為要切取內(nèi)容的那段打的內(nèi)容''''''''''''
''''strStarTag為要切取內(nèi)容的開始的地方''''''''''
''''strEndTag為要切取內(nèi)容的結(jié)束的地方''''''''''
''''GetText返回值為切取出來的內(nèi)容''''''''''''''
'''''''''''''''注釋結(jié)束''''''''''''''''''''''''
Function GetText(strText, strStartTag, strEndTag)
dim intStart
intStart = instr(strText, strStartTag)
if intStart then
intStart = intStart + len(strStartTag)
intEnd = InStr(intStart, strText, strEndTag)
GetText = Mid(strText, intStart, intEnd - intStart)
else
GetText = " "
end if
End Function
%>
%
'''''''''斷劍注釋''''''''''''
'''''''''以下的函數(shù)都可以不管'''''''''
''''''''只管入口函數(shù)getHTTPPage'''''''
''''''''path為要讀取的網(wǎng)頁地址''''''''
''''''''getHTTPPage返回讀取到的網(wǎng)頁內(nèi)容''
''''''''這里應(yīng)該注意的是gb2312這里,如果被讀取的網(wǎng)頁編碼是
''gb2312就用gb2312,如果是UTF-8的話,就換成UTF-8''''
''''''''注釋結(jié)束''''''''''
Function getHTTPPage(Path)
t = GetBody(Path)
getHTTPPage=BytesToBstr(t,"gb2312")
End function
Function GetBody(url)
on error resume next
Set Retrieval = CreateObject("Microsoft.XMLHTTP")
With Retrieval
.Open "get", url, False, "", ""
.Send
GetBody = .ResponseBody
End With
Set Retrieval = Nothing
End Function
Function BytesToBstr(body,Cset)
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 = Cset
BytesToBstr = objstream.ReadText
objstream.Close
set objstream = nothing
End Function
%>