asp如何跨站抓取頁(yè)面發(fā)布者:本站 時(shí)間:2020-05-06 16:05:47
如何用 PHp 和 ASP target=_blank>ASP 跨站抓取別的站點(diǎn)的頁(yè)面,今天我們來(lái)測(cè)試一下 ASP
是怎么實(shí)現(xiàn) 跨站抓取 別的站點(diǎn)的頁(yè)面
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("")
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 = "發(fā)生錯(cuò)誤: " & ex.Message
End Try
End Sub
</script>
<html><head>
<title>跨站</title>
</head>
<body bgcolor="#FFFFFF">
<h3><font face="Verdana">抓來(lái)得數(shù)據(jù)</font></h3>
<ASP:TextBox id="text1" Width="600px" Textmode="multiline" rows="40"
runat="server"/>
</body></html>
選擇我們,優(yōu)質(zhì)服務(wù),不容錯(cuò)過(guò)
1. 優(yōu)秀的網(wǎng)絡(luò)資源,強(qiáng)大的網(wǎng)站優(yōu)化技術(shù),穩(wěn)定的網(wǎng)站和速度保證
2. 15年上海網(wǎng)站建設(shè)經(jīng)驗(yàn),優(yōu)秀的技術(shù)和設(shè)計(jì)水平,更放心
3. 全程省心服務(wù),不必?fù)?dān)心自己不懂網(wǎng)絡(luò),更省心。
------------------------------------------------------------
24小時(shí)聯(lián)系電話:021-58370032