' URL validation
Public Function UrlIsValid(ByVal url As String) As Boolean
If url.ToLower().StartsWith("www.") Then url = "http://" & url
Dim webResponse As Net.HttpWebResponse = Nothing
Try
Dim webRequest As Net.HttpWebRequest = Net.HttpWebRequest.Create(url)
webResponse = DirectCast(webRequest.GetResponse(), Net.HttpWebResponse)
Return True
Catch
Return False
Finally
If webResponse IsNot Nothing Then webResponse.Close()
End Try
End Function
Friday, June 27, 2008
Subscribe to:
Post Comments (Atom)
2 comments:
thank you ....
............
Great Code...
Thanks.
My Name Dharmendra Bakrecha.
Mail: dkbakrecha@gmail.com
Web: http://dkbakrecha.webs.com
Post a Comment