*****CODE*****
Imports System
Imports System.Net
Imports System.IO
Public Class Form1
Private request As HttpWebRequest
Private response As HttpWebResponse
Dim stri As String
Private Sub btnWebpageTest_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnWebpageTest.Click
Me.request = WebRequest.Create(txtwebpage.Text)
Me.request.Timeout = 5000
Try
Me.response = Me.request.GetResponse()
Catch ex As Exception
lblweb.ForeColor = Color.Red
lblweb.Text = "Down"
stri = ex.ToString
txterror.Text = stri
GoTo b
End Try
lblweb.ForeColor = Color.Green
lblweb.Text = "UP"
b:
End Sub
End Class
*****End Code*****