Internet Connection

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
 
W

William Stacey [MVP]

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.)
 

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