goldfish
03-19-03, 13:31
Hey, ive just got Indy for Delphi 7, dunno if anyone else has that?
Well, basically im playing around with the ICMP object, and some pings. Here is some example code that ive been given:
procedure TForm1.ICMPReply(ASender: TComponent; const ReplyStatus: TReplyStatus);
var
sTime: string;
begin
if (ReplyStatus.TimeToLive = 0) then
sTime := '<1'
else
sTime := '=';
Memo1.Lines.Add(Format('%d bytes from %s: icmp_seq=%d ttl=%d time%s%d ms',
[ReplyStatus.BytesReceived,
ReplyStatus.FromIpAddress,
ReplyStatus.SequenceId,
ReplyStatus.TimeToLive,
sTime,
ReplyStatus.MsRoundTripTime]));
end;
So i have a memo box called Memo1 and every time it recives somthing it adds a line to it. What i want to do is ONLY ADD when the ttl is more than 0. (so basically i want it to tell me when there is somthing on the end. or not)
How could i do this?
Well, basically im playing around with the ICMP object, and some pings. Here is some example code that ive been given:
procedure TForm1.ICMPReply(ASender: TComponent; const ReplyStatus: TReplyStatus);
var
sTime: string;
begin
if (ReplyStatus.TimeToLive = 0) then
sTime := '<1'
else
sTime := '=';
Memo1.Lines.Add(Format('%d bytes from %s: icmp_seq=%d ttl=%d time%s%d ms',
[ReplyStatus.BytesReceived,
ReplyStatus.FromIpAddress,
ReplyStatus.SequenceId,
ReplyStatus.TimeToLive,
sTime,
ReplyStatus.MsRoundTripTime]));
end;
So i have a memo box called Memo1 and every time it recives somthing it adds a line to it. What i want to do is ONLY ADD when the ttl is more than 0. (so basically i want it to tell me when there is somthing on the end. or not)
How could i do this?