Hack Forums
[.NET] [VB.NET]Check URL for availability - Printable Version

+- Hack Forums (https://hackforums.net)
+-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444)
+--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151)
+---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118)
+---- Thread: [.NET] [VB.NET]Check URL for availability (/showthread.php?tid=400888)



[VB.NET]Check URL for availability - codepoet - May 3, 2010

Description:

This function checks if a given internet address is available.

Code
Public Function CheckURL(ByVal URL As String) As Boolean
    Try
        Dim Response As Net.WebResponse = Nothing
        Dim WebReq As Net.HttpWebRequest = Net.HttpWebRequest.Create(URL)
        Response = WebReq.GetResponse
        Response.Close()
        Return True
        Catch ex As Exception
        Return False    
        End Try
End Function

originally posted on dotnet-snippets.com

[img]http://i685.photobucket.com/albums/vv215/blackpearl4/THANKS.gif[/img]
If You Like this tutorial, please check out my other tutorials by clicking ==> H3R3


* - Vice - May 3, 2010

Catch ex As Exception
Return False
End Try


* - codepoet - May 3, 2010

all fixed...thanks for correcting me


* - iRtehLeet™ - May 3, 2010

This was posted in this section like 2 hrs before you posted yours..

https://hackforums.net/showthread.php?tid=400587

Exact same code dude.. stop copy+pasting codes into your own threads..


* - codepoet - May 3, 2010

(May 3, 2010 07:31 PM)iRtehLeet™ Wrote:  This was posted in this section like 2 hrs before you posted yours..

https://hackforums.net/showthread.php?tid=400587

Exact same code dude.. stop copy+pasting codes into your own threads..

this is funny because i am Tim Hartwig

and i showed yager my website.... lol


no need to appologise. but know i dont leach! EVER!!!


* - iRtehLeet™ - May 3, 2010

Alright, just stating it was already posted, no need for multiple threads.


* - codepoet - May 3, 2010

i never knew it was posted...i did not know my work would be here...which is why i have started posting my snippets on HF