Skip to content

Latest commit

 

History

History
41 lines (30 loc) · 1.12 KB

sample_324.md

File metadata and controls

41 lines (30 loc) · 1.12 KB

Home

Determining if an Active Network Connection is Available

Code:

#DEFINE NETWORK_ALIVE_LAN 1
#DEFINE NETWORK_ALIVE_WAN 2
#DEFINE NETWORK_ALIVE_AOL 4

DECLARE INTEGER IsNetworkAlive IN sensapi INTEGER @lpdwFlags
DECLARE INTEGER GetLastError IN kernel32

LOCAL lnMode
lnMode = 0
IF IsNetworkAlive(@lnMode) = 0
	? "Error code: ", GetLastError()
ELSE
	? "The computer has one or more LAN cards that are active:",;
		(lnMode=NETWORK_ALIVE_LAN)

	? "The computer has one or more active RAS connections:",;
		(lnMode=NETWORK_ALIVE_WAN)

	* Win95, Win98 only
	? "The computer is connected to the America Online network:",;
		(lnMode=NETWORK_ALIVE_AOL)
ENDIF  

Listed functions:

GetLastError
IsNetworkAlive

Comment:

Check similar VB example "Determining if an Active Network Connection is Available" at the VBNet.