Results 1 to 3 of 3

Thread: [RESOLVED] Checking internet connection

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 2005
    Location
    Lancashire UK
    Posts
    375

    Resolved [RESOLVED] Checking internet connection

    I'm writing an application that will grab data from a database stored on the internet. I need to check if the computer has an active internet connection when the application launches and if not prompt the user to connect.

    How do I check if an internet connection is open ?

  2. #2
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373

    Re: Checking internet connection

    well there isn't just an easy IsConnectedToInternet function, but there are some ways to cover as many bases as possible..

    one option is to simply just try to connect to the server, if it fails, alert the user that a connection could not be made, and to check to make sure they are connected to the internet, if the problem persits please check your firewall settings blah blah..."

    which actually brings up another point that depending HOW your app connects to get this data, you may run into firewall problems

    another method you can try is to simply create a web request to a known webpage that should be available (like microsoft.com, or even your own site if you have one) here is an example
    http://www.developerfusion.co.uk/show/3903/

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 2005
    Location
    Lancashire UK
    Posts
    375

    Re: Checking internet connection

    Thanks for your help.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width