When I use this code...
With...VB Code:
Private Function CheckURL(ByVal site As String) As Boolean Dim request As System.Net.WebRequest Try Dim url As New System.Uri(site) request = System.Net.WebRequest.Create(url) Dim response As System.Net.WebResponse = request.GetResponse() response.Close() request = Nothing Return True Catch request = Nothing Return False End Try End Function
VB Code:
MsgBox(CheckURL("http://www.google.com")) MsgBox(CheckURL("http://www.googlexyz.com"))
the IDE stops execution on the second URL and throws up the exception dialog box. If I step it forward, it moves onto the Catch correctly. Is there a way to prevent the IDE stopping when it hits a WebException? (It only seems to do this with a WebException). I'd like the code to proceed onto the Catch without my intervention.
If I build the solution, it works correctly (but then I cant do any debugging).


Reply With Quote