leontager Posted August 12, 2003 Posted August 12, 2003 sometimes my ISP dropps the connection. my program creates a stream of a URL and reports back. I would like it to report seomthing else if it was unable to reach the website. stream = New IO.StreamReader(wc.OpenRead(URL) what should I add? Quote
BrianHansen Posted August 13, 2003 Posted August 13, 2003 My guess is that your wc is the Webclient.. This is c#, try { stream = New IO.StreamReader(wc.OpenRead(URL) } catch( Exception ) { MessageBox.Show("You lost your connection"); } Obviously you don't need to use the messagebox, but can do whatever you wish to do. Quote
leontager Posted August 13, 2003 Author Posted August 13, 2003 thank you very much. It works perfectly. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.