<%
''''''''''''''''''''''Sword breaking comment '''''''''''''''''''''' '''
'''''Strtext indicates the content of the part to be cut ''''''''''''
'''''Strstartag is the place where the content is to be cut ''''''''''
''' Strendtag is the end of the content to be cut ''''''''''
''' The returned value of gettext is the obtained content ''''''''''''''
'''''''''''''''''''''End of 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
%>
<%
''' comment '''
' ''''' or lower functions can ignore '''''''''
''''''' ''', only the entry function gethttppage'' '''''
''' path indicates the address of the webpage to be read '''
'''''' ''gethttppage: returned webpage content '''
''' note that gb2312 is used here, if the read webpage code is
''gb2312, use gb2312. If it is a UTF-8, replace it with the UTF-8 '''
''' comment to end '''
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
%>