Re: Ping et net send comme sous dos(Presque)

Posté par Anonyme le 16/9/2003 11:59:32
ou bien un simple petit ping avec cette "petite" fonction :

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


Cette contribution était de : http://old.wdforge.org/newbb/viewtopic.php?forum=5&topic_id=204&post_id=894