Results 1 to 4 of 4

Thread: Net Connection - Please Help

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Sep 2001
    Posts
    83

    Angry Net Connection - Please Help

    I need a 100% accurate way to detect if there is an active connection to the internet. The only way there seems to be so far is pinging a site but this can take a long time. Other methods only check for via modem or via LAN etc.

    Is there a way of checking connection no matter how you are connected (via modem, Lan etc.) ???

    Thanks a lot

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333
    Try this
    VB Code:
    1. 'posted by peet
    2. Private Declare Function InternetGetConnectedState Lib "wininet.dll" (ByRef lpSFlags As Long, ByVal dwReserved As Long) As Long
    3. Private Sub Command1_Click()
    4.     If InternetGetConnectedState(0, 0) Then
    5.         MsgBox "Online"
    6.     Else
    7.         MsgBox "Offline"
    8.     End If
    9. End Sub

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Sep 2001
    Posts
    83
    Thanks. I'll try it and see.

  4. #4
    Frenzied Member
    Join Date
    Oct 2000
    Posts
    1,463
    This last way returns Online for me no matter if I unplug my cable modem or not. Does anyone have a better way that works for ALL internet connections?

    Thanks!

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