Hack Forums
[.NET] [VB.NET] Check If URL is Available - 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 If URL is Available (/showthread.php?tid=400587)



[VB.NET] Check If URL is Available - Suрernatural - May 3, 2010

Credit = Tim Hartwig

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
    End Try
End Function



* - codepoet - May 3, 2010

please dont post my work on HF without asking me first....


* - PITTSKATERG - May 3, 2010

his was posted several hours before yours, and he gave credit to someone


* - Vice - May 3, 2010

I put this in the other thread as well, but you should add Return False in between Catch ex As Exception and End Try.


* - Suрernatural - May 4, 2010

(May 3, 2010 07:50 PM)crow407 Wrote:  please dont post my work on HF without asking me first....

Sorry I gave proper credits do.