<%
''''''''''''''''Broken Sword Comments'''''''''''''''''''''''
''''strText is the content of the section to be cut out''''''''''''
''''strStarTag is the starting point of the content to be cut''''''''''
''''strEndTag is the end of the content to be cut''''''''''
''''GetText return value is the cut out content''''''''''''''
'''''''''''''''End comment''''''''''''''''''''
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
%>
<%
'''''''''Broken Sword Comments''''''''''
'''''''''The following functions can be ignored'''''''''
''''''''Just use the entry function getHTTPPage'''''''
''''''''path is the web page address to be read''''''''
''''''''getHTTPPage returns the read web page content''
'''''''' What should be noted here is gb2312. If the code of the web page being read is
''For gb2312, use gb2312. If it is UTF-8, change it to UTF-8''''
''''''''End of comment''''''''''
Function getHTTPage(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
%>