Postup:
Na systΘmech Windows NT/2000 jsou pouze dva mo₧nΘ typy p°ipojenφ - LAN
nebo WAN, zatφmco Windows 9x mohou detekovat jeÜt∞ t°etφ typ - AOL.
Funkce zde uvßd∞nΘ pracujφ ve Windows 2000 nebo ve starÜφch verzφch s
nainstalovan²m IE 5.x
Private
Declare Function IsNetworkAlive Lib "Sensapi" _
(lpdwFlags As Long) As Long
Private Const NETWORK_ALIVE_LAN = &H1 'P°ipojenφ
pomocφ sφ¥ovΘ karty
Private Const NETWORK_ALIVE_WAN = &H2 'RAS
Private Const NETWORK_ALIVE_AOL = &H4 'AOL
Private Function IsNetConnectionAlive() As Boolean
'Zjiܥuje,
zda je jakΘkoliv p°ipojenφ k sφti aktivnφ.
'Vracφ True, pokud je p°ipojenφ aktivnφ, jinak False
Dim tmp As Long
IsNetConnectionAlive = IsNetworkAlive(tmp) = 1
End Function
Private Function IsNetConnectionLAN() As Boolean
'Zjiܥuje,
zda je aktivnφ p°ipojenφ k sφti LAN.
'Vracφ True, pokud je p°ipojenφ aktivnφ, jinak False
Dim tmp
As Long
If IsNetworkAlive(tmp) = 1 Then
IsNetConnectionLAN = tmp = NETWORK_ALIVE_LAN
End If
End Function
Private Function IsNetConnectionRAS() As Boolean
'Zjiܥuje,
zda je aktivnφ p°ipojenφ k sφti pomocφ RAS.
'Vracφ True, pokud je p°ipojenφ aktivnφ, jinak False
Dim tmp
As Long
If IsNetworkAlive(tmp) = 1 Then
IsNetConnectionRAS = tmp = NETWORK_ALIVE_WAN
End If
End Function
Private Function IsNetConnectionAOL() As Boolean
'Zjiܥuje,
zda je aktivnφ p°ipojenφ k sφti AOL.
'Vracφ True, pokud je p°ipojenφ aktivnφ, jinak False
Dim tmp
As Long
If IsNetworkAlive(tmp) = 1 Then
IsNetConnectionAOL = tmp = NETWORK_ALIVE_AOL
End If
End Function
|