Re: PING

Posté par Totof le 8/12/2005 8:21:57
Bonjour,

Voici une fonction ping qui ne vous bloquera pas :


FONCTION Gbl_Ping_adresseIP(IpHote_)

IpHote est une chaîne = IpHote_ // Par défaut
TimeOut est un entier 
retVal est un entier
hIcmp est un entier
SizeReply est un entier
ReplyData est un entier
IpAdress est un entier

IpAdress = AppelDLL32("Wsock32", "inet_addr", IpHote)
// Mauvaise adresse IP
SI IpAdress = 0xFFFFFFFF ALORS 
	RENVOYER  Faux
FIN

SizeReply = 255
TimeOut = 25
hIcmp = AppelDLL32("icmp", "IcmpCreateFile")

retVal = AppelDLL32("icmp", "IcmpSendEcho", hIcmp, IpAdress, 0, 0, Null, &ReplyData, SizeReply, TimeOut)
AppelDLL32("icmp", "IcmpCloseHandle", hIcmp)

RENVOYER retVal



Bon dév.,

Totof

Cette contribution était de : http://old.wdforge.org/newbb/viewtopic.php?forum=14&topic_id=3179&post_id=13424