Santaslittlehelper
New member
- Joined
- Dec 15, 2012
- Messages
- 2
- Programming Experience
- 3-5
Is this the quickest method of downloading a webpage's source with vb.net?
VB.NET:
PublicClassNameList
Dim thread As System.Threading.Thread
Dim sourcecode As String
Sub GetSource()
Dim request As System.Net.HttpWebRequest = System.Net.HttpWebRequest.Create("[URL="http://www.websiteidliketouse.co.uk/"]http://www.websiteidliketouse.co.uk[/URL]")
Dim response As System.Net.HttpWebResponse = request.GetResponse()
Dim sr As System.IO.StreamReader = New System.IO.StreamReader(response.GetResponseStream())
sourcecode = sr.ReadToEnd()
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
thread = New System.Threading.Thread(AddressOf GetSource)
thread.Start()
End Sub
End Class