That was a good thought, but it's doing the same thing. When I disconnect my internet and try the code, I get the "no internet" response like i was expecting. But when I reconnect and try again, I get the exception shown at the bottom, it also hangs for quite a few seconds before spitting out the exception.
Code:
Dim myRequest As WebRequest = WebRequest.Create(http://www.google.com)
Dim myResponse As WebResponse
Try
myResponse = myRequest.GetResponse()
myResponse.Close()
Catch ex As WebException
message_textbox.Text = ex.ToString()
EndTry
Exception after trying to reconnect:
System.Net.WebException: Unable to connect to the remote server ---> System.Net.Sockets.SocketException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond
at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)
at System.Net.Sockets.Socket.InternalConnect(EndPoint remoteEP)
at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Int32 timeout, Exception& exception)
--- End of inner exception stack trace ---
at System.Net.HttpWebRequest.GetResponse()