Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to detect lost LAN connection
Message
 
 
À
01/03/2007 16:29:53
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
VFP 9
Divers
Thread ID:
01200113
Message ID:
01200117
Vues:
28
>HI all,
>
>is there a way to know when the computer has lost the LAN connection, so that I can close everything and/or shut the application?
>
>Thanks,
>javier.

See Message #684995

Also from wwww.foxclub.ru forum:

http://forum.foxclub.ru/read.php?29,190587,190826#msg-190826

Solution from AlexSSS (don't know his real name):
machine	= ALLTRIM(comp_name)  
  	objPing2 = GETOBJECT("winmgmts:")  
  	objPing	= objPing2.ExecQuery("select * from Win32_PingStatus where address = '&Machine'")  
  	FOR EACH objStatus IN objPing  
  		IF ISNULL(objStatus.StatusCode) OR objStatus.StatusCode<>0 Then  
  			? machine+" not found"  
  			EXIT  
  		ENDIF  
  	NEXT
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform