Internet Connection

  • Thread starter Thread starter Doug Handler
  • Start date Start date
D

Doug Handler

Hi,

We're currently creating an Winform application that will require access to
the internet and I need a solid way to check for an Internet connection.
Since all the users computers will be connected either directly to the
internet (no router / firewall) or via a LAN of sorts, I need to be sure
that they can reach the internet itself. Even better and more secure for
our purposes, is if they can reach our website. Does anyone have a nice
solid function / class that does this (probably using WinInet.dll) that
would be willing to provide it to me? Thanks in advance.

Doug
 
One way is use the webrequest to grab a page and check the first few lines
are right or that you got a reply at all. That you explicitly check your
web site is up and implicitly know the INET connection is up. You can catch
errors or check returns codes (have to look into webrequest to see the
returns/exceptions.)
 
Back
Top