irvann
asked on
Get ping IP result with Delphi
If I pinging an IP Address, what should I do to get pinging result and status with delphi?
ASKER
thank for you fast responses, I'll try it.
ASKER
what 'YourComputerName' as IP? because my computer connected in LAN and when I check in "obtain a IP address automatically", what I fill in 'YourComputerName'?
if you want to pint yourself just use loopback ip 127.0.0.1
but what is the sense of pinging yourself?
BTW is there a fast way to display the delay time of the reply?
but what is the sense of pinging yourself?
BTW is there a fast way to display the delay time of the reply?
ASKER
How to convert this command to Delphi
ping 204.159.0.20 -t
ping 204.159.0.20 -t
ASKER
How to convert each status from ping to String like command ping?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
How to get status from ping result(e.g Request time out, etc)?
go to www.torry.net and look for TICMP component, its great "Ping" useing just core icmp protocol, with sample and source code.
ziolko.
ziolko.
ASKER
Basically i accepted answer from motaz. bUT, Thanks for all comments for my question.
For get status from ping result i find in :
http://www.tutorials.delphi-source.de/indy/file013.shtml
For get status from ping result i find in :
http://www.tutorials.delphi-source.de/indy/file013.shtml
this error undeclared identifier idping was occurred when I used this code:
idICMPClient1.Host:= 'YourComputerName';
idICMPClient1.Ping();
// Then read ReplyStatus:
Memo1.Lines.Add('Bytes received: ' + IntToStr(idPing.ReplyStatu s.BytesRec eived));
So, could anybody help me to know in which type I can declare it?
Regards
idICMPClient1.Host:= 'YourComputerName';
idICMPClient1.Ping();
// Then read ReplyStatus:
Memo1.Lines.Add('Bytes received: ' + IntToStr(idPing.ReplyStatu
So, could anybody help me to know in which type I can declare it?
Regards
Change this line:
Memo1.Lines.Add('Bytes received: ' + IntToStr(idICMPClient1.Rep lyStatus.B ytesReceiv ed));
Memo1.Lines.Add('Bytes received: ' + IntToStr(idICMPClient1.Rep
idICMPClient1.Host:= 'YourComputerName';
idICMPClient1.Ping();
// Then read ReplyStatus:
Memo1.Lines.Add('Bytes received: ' + IntToStr(idPing.ReplyStatu
Motaz