View html page source


we can view the HTML source code by using the following code.

Following code will explain how to view the html page source of
the website.

WebRequest and WebResponse do this job with the help of
StreamReader.

Name space part


Imports System.Net
Imports System.IO


Code Part

Dim inStream As StreamReader
Dim webRequest As WebRequest
Dim webresponse As WebResponse
webRequest = webRequest.Create("www.dotnetspider.com\Home.aspx")
webresponse = webRequest.GetResponse()
inStream = New StreamReader(webresponse.GetResponseStream())
TextBox1.Text = inStream.ReadToEnd()



By
Nathan


Comments

No responses found. Be the first to comment...


  • Do not include your name, "with regards" etc in the comment. Write detailed comment, relevant to the topic.
  • No HTML formatting and links to other web sites are allowed.
  • This is a strictly moderated site. Absolutely no spam allowed.
  • Name:
    Email: