Provides several functions on acquisition (ASP) _ Thieves/Collection

Source: Internet
Author: User

<%
' ', ' ' ', ' ', ' ', ' ', ' ', ' ' ' ' ' "" "" "", "" "," "," "", "", "", "" strtext " Strstartag for the beginning of the content to be cut "'" "" "" "" "' Strendtag" for the end of the content to be cut "" ' "'
'" ' GetText return value is cut out of the content ' "'" ' "' '
' ' ', ' ' ' ' ' ' ' ' ' ' ' annotation ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' 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 Annotation ' ', ' ' ' ' ' ' ' ' "' Path is the address of the Web page to be read '
'" '. "" "' gethttppage return read the content of the Web page ' '
'", "" here should note gb2312 here, If the Read page encoding is
' gb2312, use gb2312, and if it is UTF-8, replace it with the UTF-8 ' '
' "' '" ' "', ' '" ' "'" ' "
T = getbody (Path)
Gethttppage=bytestobstr (t, "gb2312")
End Function

Function getbody (URL)
On Error Resume Next
Set retrieval = CreateObject ("Microsoft.XMLHTTP")
with Retrieva L
. Open "Get", url, False, "", ""
. Send
GetBody =. Responsebody
End With
Set retrieval = no
End Function
function bytestobstr (body,cset)
Dim objstre Am
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 = no
end Function
%>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.