PDA

Click to See Complete Forum and Search --> : Checking Ethernet Connection


leemy298
Dec 7th, 2000, 08:31 AM
I am writing an app that will be used by the sales force from around the country to dial into the ethernet and check their email and stuff. What is the easiest way to check for an ethernet connection?

Thanks!
leemy298

echofoxtrot
Dec 7th, 2000, 12:03 PM
in the module:

Option Explicit
Public Declare Function InternetGetConnectedState _
Lib "wininet.dll" (ByRef lpSFlags As Long, _
ByVal dwReserved As Long) As Long

Public Const INTERNET_CONNECTION_LAN As Long = &H2


Public Function ViaLAN() As Boolean

Dim SFlags As Long
'return the flags associated with the connection
Call InternetGetConnectedState( SFlags, 0& )

'True if the Sflags has a LAN connection
ViaLAN = SFlags And INTERNET_CONNECTION_LAN

End Function

in the code:

'this will return a true/false to text1.text
text1.text = ViaLan()