Willkommen ~Gast!
Registrieren || Einloggen || Hilfe/FAQ || Staff
Probleme mit der Registrierung im Forum? Melde dich unter registerEin Bild.
Autor Beitrag
000
16.04.2002, 20:34
Agent_Wurzellseep



Hi ich mach meine frage kurz:
Wie kann Vb6 erkennen ob ich im Internet bin????

--

zum Seitenanfang zum Seitenende Profil || Suche
001
16.04.2002, 22:57
Ferdi



Quellcode:
Public Declare Function InternetGetConnectedState Lib "wininet.dll" (ByRef lpdwFlags As Long, ByVal dwReserved As Long) As Long
    'Internet connection VIA Proxy server.
    Public Const ProxyConnection As Long = &H4
    
    'Modem is busy.
    Public Const ModemConnectionIsBusy As Long = &H8

    'Internet connection is currently Offline
    Public Const InternetIsOffline As Long = &H20
    
    'Internet connection is currently configured
    Public Const InternetConnectionIsConfigured As Long = &H40
    
    'Internet connection VIA Modem.
    Public Const ModemConnection As Long = &H1
    
    'Remote Access Server is installed.
    Public Const RasInstalled As Long = &H10

    'Internet connection VIA LAN.
    Public Const LanConnection As Long = &H2
    
    
    


Public Function IsLanConnection() As Boolean
    Dim dwflags As Long
    'return True if LAN connection
    Call InternetGetConnectedState(dwflags, 0&)
    IsLanConnection = dwflags And LanConnection
End Function


Public Function IsModemConnection() As Boolean
    Dim dwflags As Long
    'return True if modem connection.
    Call InternetGetConnectedState(dwflags, 0&)
    IsModemConnection = dwflags And ModemConnection
End Function


Public Function IsProxyConnection() As Boolean
    Dim dwflags As Long
    'return True if connected through a proxy.
    Call InternetGetConnectedState(dwflags, 0&)
    IsProxyConnection = dwflags And ProxyConnection
End Function


Public Function IsConnected() As Boolean
    'Returns true if there is any internet connection.
    IsConnected = InternetGetConnectedState(0&, 0&)
End Function


Public Function IsRasInstalled() As Boolean
    Dim dwflags As Long
    'return True if RAS installed.
    Call InternetGetConnectedState(dwflags, 0&)
    IsRasInstalled = dwflags And RasInstalled
End Function

--

zum Seitenanfang zum Seitenende Profil || Suche