/ Published in: VB.NET
You can use this to get the page source code of any valid URL. Tested on VS2010.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
Function getPageSource(ByVal url As String) As String Dim sourcecode As String = String.Empty Try Dim request As System.Net.HttpWebRequest = System.Net.HttpWebRequest.Create(url) Dim response As System.Net.HttpWebResponse = request.GetResponse() Dim sr As System.IO.StreamReader = New System.IO.StreamReader(response.GetResponseStream()) sourcecode = sr.ReadToEnd() Catch ex As Exception End Try Return sourcecode End Function