Results 1 to 3 of 3

Thread: how to detect a internet connection ?

  1. #1

    Thread Starter
    New Member
    Join Date
    Jan 2002
    Posts
    2

    Unhappy how to detect a internet connection ?



    Hi,

    I'm new with Vb so be patient plz. Here is my question:

    How to detect if a internet connection is active? I need a program
    which will sit on the background and if the user starts a connection then it starts to record the time he spends online.

    I suspect i need to use some api, but i'm not sure which one.


    Thanks in advance !!

  2. #2
    -= B u g S l a y e r =- peet's Avatar
    Join Date
    Aug 2000
    Posts
    9,629
    try this

    VB Code:
    1. Private Declare Function InternetGetConnectedState Lib "wininet.dll" (ByRef lpSFlags As Long, ByVal dwReserved As Long) As Long
    2. If InternetGetConnectedState(0, 0) Then
    3.     MsgBox "Online"
    4. Else
    5.     MsgBox "Offline"
    6. End If
    -= a peet post =-

  3. #3

    Thread Starter
    New Member
    Join Date
    Jan 2002
    Posts
    2

    Thanks peet

    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