I have a URL that I must check to see if it's working before following through with some other code relative to the URL. So what I need is a function that will return True or False if the URL works or not. I tried this, but it doesn't seem to work:
Code:
Public Shared Function UrlIsValid(ByVal smtpHost As String) As Boolean
Dim br As Boolean = False
Try
Dim ipHost As Net.IPHostEntry = Dns.GetHostEntry(smtpHost)
br = True
Catch se As Net.Sockets.SocketException
br = False
End Try
Return br
End Function