webBrowser control, how to detect user is not connected to interne

B

BatKing

Hi,

I have a from which has a System.Windows.Forms.WebBrowser control in there.
my question is How can I tell the user is not connected to internet?

Currently I am trying to get the webBrowser.DocumentText or
WebBrowser.DocumentTitle and try to see if the content of the DocumentText
has some error message in there during DocumentCompleted event. but this is
kind of stupid and what if the user is using a Non-English windows OS?

Thanks.
 
K

Ken Slovak - [MVP - Outlook]

There really isn't a perfect way to tell if the user is or isn't connected
to the Internet. You can try a ping call to a known IP address, but that
would produce misleading results if for some reason that one site wasn't
available due to some sort of DNS or server problems. I usually try a couple
of sites such as www.google.com and www.microsoft.com to see about an
Internet connection.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top