%
''''''''''''''''斷劍注釋'''''''''''''''''''''''''
''''strText為要切取內容的那段打的內容''''''''''''
''''strStarTag為要切取內容的開始的地方''''''''''
''''strEndTag為要切取內容的結束的地方''''''''''
''''GetText返回值為切取出來的內容''''''''''''''
'''''''''''''''注釋結束''''''''''''''''''''''''
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為要讀取的網頁地址''''''''
''''''''getHTTPPage返回讀取到的網頁內容''
''''''''這里應該注意的是gb2312這里,如果被讀取的網頁編碼是
''gb2312就用gb2312,如果是UTF-8的話,就換成UTF-8''''
''''''''注釋結束''''''''''
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
%>