How to use PHp and Asp across the site to crawl other sites of the page, today we test the asp+
How to implement a cross station crawl another site page
Code Listing
<%@ Assembly name= "System.Net"%>
<%@ Import namespace= "System.Net"%>
<%@ Import namespace= "System.IO"%>
<script language= "VB" runat= "Server" >
Sub Page_Load (Src as Object, E as EventArgs)
Dim Httpwresp as HttpWebResponse
Dim SR as StreamReader
Dim strtemp As String
Text1.Text = ""
Httpwreq = Webrequestfactory.create ("Http://www.asp888.net")
Httpwreq.keepalive = False
Httpwresp = Httpwreq.getresponse ()
sr = new StreamReader (Httpwresp.getresponsestream (), ENCODING.ASCII)
Try
LINE=SR. ReadLine ()
Do While line <> null
line = Sr. ReadLine ()
Lineenc = Server. HTMLencode (line) & vbCrLf & "<br>"
Text1.Text = Text1.Text & Lineenc
Loop
Catch ex as Exception
Text1.Text = "Error occurred:" & ex. Message
End Try
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