VB - Check URL for availability

By , 4/28/2008
(1 ratings)
This function checks if a given internet address is available.
Translate to C#
Public Function CheckURL(ByVal URL As String) As Boolean
        Dim Response As Net.WebResponse = Nothing
        Dim WebReq As Net.HttpWebRequest = Net.HttpWebRequest.Create(URL)
        Response = WebReq.GetResponse
        Return True
    Catch ex As Exception
    End Try
End Function
Tagged with url, uri, http.



Log in, to comment!