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

  • Thread starter Thread starter BatKing
  • Start date Start date
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.
 
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.
 
Back
Top