CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Apr 2001
    Location
    ohio
    Posts
    300

    testing for online status

    is there any way to see if the user is logged on to the internet???

    Ron



  2. #2
    Join Date
    Apr 2000
    Posts
    737

    Re: testing for online status

    check the API RasEnumConnections.

    cksiow
    http://vblib.virtualave.net - share our codes



  3. #3
    Join Date
    May 2000
    Location
    New York, NY, USA
    Posts
    2,878

    Re: testing for online status

    'In a Module..
    Private Declare Function RegOpenKey Lib "advapi32.dll" Alias "RegOpenKeyA" (ByVal hKey As Long, ByVal lpSubKey As String, phkResult As Long) As Long
    Private Declare Function RegQueryValueEx Lib "advapi32.dll" Alias "RegQueryValueExA" (ByVal hKey As Long, ByVal lpValueName As String, ByVal lpReserved As Long, lpType As Long, lpData As Any, lpcbData As Long) As Long ' Note that if you declare the lpData parameter as string, you must pass it By Value.
    Private Declare Function RegCloseKey Lib "advapi32.dll" (ByVal hKey As Long) As Long
    Private Const HKEY_LOCAL_MACHINE = &H80000002

    Public Function IsConnected() As Boolean
    Dim lRegKey As Long
    Dim bData(3) As Byte

    If RegOpenKey(HKEY_LOCAL_MACHINE, "System\CurrentControlSet\Services\RemoteAccess", lRegKey) = 0 Then
    'Opened RegKey Successfully..
    If RegQueryValueEx(lRegKey, "Remote Connection", 0&, 1&, bData(0), 4) = 0 Then
    'Query the Value of "Remote Connection" 1 - Connected, 0 - Not Connected
    IsConnected = bData(0)
    Else
    'Counldn't find the Value, assume no Connection
    IsConnected = False
    End If
    'Close the Registry Key
    Call RegCloseKey(lRegKey)
    End If
    End Function




    Iouri Boutchkine
    [email protected]
    Iouri Boutchkine
    [email protected]

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

Featured