
Determinar si un PC o servidor esta ON LINE
Publicado por Ernesto Hernandez (4623 intervenciones) el 24/07/2007 05:40:00
Con esta función API podemos determinar si un PC o servidor esta ON LINE.
Declare Integer GetRTTAndHopCountIn Iphlpapi;
INTEGER DestIpAddress, Long @HopCount,;
INTEGER MaxHops, Long @RTT
Declare Integer inet_addr In ws2_32 String cp
Local nDst, nHop, nRTT
Store 0 To nHop, nRTT
nDst = inet_addr("192.168.0.5")
If GetRTTAndHopCount(nDst, @nHop, 50, @nRTT) <> 0
? "# de intentos de contactar el destino:", nHop
? "Tiempo de respuesta, en millisegundos:", nRTT
Else
? "Error Destino no se encuentra"
EndIf
Declare Integer GetRTTAndHopCountIn Iphlpapi;
INTEGER DestIpAddress, Long @HopCount,;
INTEGER MaxHops, Long @RTT
Declare Integer inet_addr In ws2_32 String cp
Local nDst, nHop, nRTT
Store 0 To nHop, nRTT
nDst = inet_addr("192.168.0.5")
If GetRTTAndHopCount(nDst, @nHop, 50, @nRTT) <> 0
? "# de intentos de contactar el destino:", nHop
? "Tiempo de respuesta, en millisegundos:", nRTT
Else
? "Error Destino no se encuentra"
EndIf
Valora esta pregunta


0