How to Extract or Read Website/Webpage URL Content In VB.Net

Q.: Create a Windows Application in VB.Net 2008 which is used to Read/Extract URL content of a webpage from website.

In VB.Net 2008, sometimes we have require to Read URL content. This Example Shows How to Read URL content. We can read/extract source code of a webpage of website easily. This helps in getting objects used on webpages like textbox, elements.

Compatibility/Version:  Microsoft Visual Studio 2008 (Microsoft .Net Framework 3.5)

Source Code:

Imports System.Net
Imports System.IO
Public Class Form1
    Private Sub Button1_Click(ByVal sender As System.Object, _
    ByVal e As System.EventArgs) Handles Button1.Click
        Dim inStream As StreamReader
        Dim webRequest As WebRequest
        Dim webresponse As WebResponse
        webRequest = webRequest.Create(TextBox1.Text)
        webresponse = webRequest.GetResponse()
        inStream = New StreamReader(webresponse.GetResponseStream())
        TextBox2.Text = inStream.ReadToEnd()
    End Sub
End Class

Output:

Download Now (.Zip File 100 KB)…

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

CommentLuv badge

Human Verification: In order to verify that you are a human and not a spam bot, please enter the answer into the following box below based on the instructions contained in the graphic.