How do you check if webclient.DownloadData is working?

korae

Member
Joined
Jan 24, 2010
Messages
22
Programming Experience
Beginner
How do you check if webclient.downloaddata is working? I mean what if the site you are trying to access suddenly turns down. How do you avoid getting an error? Below is an example code:

VB.NET:
Dim webclient As New WebClient

Dim eIP As String

eIP = System.Text.Encoding.ASCII.GetString((webclient.DownloadData("http://www.vbdotnetforums.com")))

Label1.Text = eIP
 
Back
Top