網頁小偷程式ASP.net

來源:互聯網
上載者:User
以前寫過一個網頁小偷程式,是ASP版的
http://aowind.cnblogs.com/archive/2005/07/16/193858.html

今天看到.net裡的WEBCLIENT,試試了它的方法等,發現很好用,就用它改成了以前ASP版的網頁小偷,寫成ASP.net版的了,嘿嘿!

Imports System.net
Imports System.io
Public Class WebForm1Class WebForm1
    Inherits System.Web.UI.Page
 Public web As New WebClient
    Private Sub Page_Load()Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        '讀網頁源檔案先
        If Session("aaa") = "" Then
            Dim str As Stream
            str = web.OpenRead("http://www.023ehouse.com")
            Dim read As New StreamReader(str, System.Text.Encoding.GetEncoding("GB2312"))
            Dim html As String = read.ReadToEnd()
            '接下來當然是分析源檔案,提出自己要用的了
            Dim aaa, bbb, ccc '這裡定義的都是用來處理結果的,要把中間自己要用的新聞給截取出來
            aaa = CStr(html)
            bbb = Split(aaa, "<div id=""onlinemb_05"">")
            aaa = bbb(1)
            ccc = Split(bbb(1), "</div>")
            aaa = ccc(0)

            '這裡是把新聞地址轉到自己的新聞顯示頁面,把本來的新聞地址當參數傳給頁面
            aaa = Replace(aaa, "href=""", "href=""newsshow.asp?url=http://www.023ehouse.com/")
            aaa = Replace(aaa, "target=""_blank""", "")

            '這裡就是寫session了
            Session("aaa") = aaa

        End If

        '最後把處理好的輸出
        Response.Write(Session("aaa"))
   End Sub
End Class

其實這裡就是看WEBCLIENT的用處了,

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.