I just thought this could be useful, downloading files using the System.Net namespace .
First of all you have to import the System.Net namespace
Then you need to declare a new instance of a WebClient class which will be used to download the data.
Now there are two ways you can download, download to a file, or download the data as bytes.
THis is how you would download a file and as bytes:
This will download the HTML of the main page of the forums. But to the HTML in lets say a textbox you need to translate to a string like this:
Then you can assign it to lets say a textbox to display the html.
Other way is to download things to a file:
First argument is the address of the file and then the path at which to save it.
I hope this is useful to someone .
First of all you have to import the System.Net namespace
Code:
Imports System.Net
Code:
Dim webc As New WebClient
THis is how you would download a file and as bytes:
Code:
Dim data() As Bytes = webc.DownloadData("http://www.techist.com")
Code:
Dim stringdata As String = System.Text.Encoding.Ascii.GetString(data)
Other way is to download things to a file:
Code:
webc.DownloadFile("http://www.techist.com", "C:\techforumshtml.html")
I hope this is useful to someone .