Newsgroups : Borland : borland.public.delphi.internet.winsock : 2006 Apr : idIcmp error msgs D7 indy10.1.5
| Subject: | idIcmp error msgs D7 indy10.1.5 |
| Posted by: | "Jacques Noah" (jacques.no..@btinternet.com) |
| Date: | Tue, 25 Apr 2006 12:34:29 |
Hi
i'm getting the following errors when trying to run the code below:
IdIcmpClient.Host := '192.168.0.1';
IdIcmpClient.TTL := 50; //Time to live
IdIcmpClient.ReceiveTimeout := 5000;
IdIcmpClient.Ping;
case IdIcmpClient.ReplyStatus.ReplyStatusType of
rsEcho:
begin
lbLog.Items.Append(format('response from host %s in %d millisec.',
[IdIcmpClient.ReplyStatus.FromIpAddress,
IdIcmpClient.ReplyStatus.MsRoundTripTime]));
result := true;
end;
rsError:
lbLog.Items.Append('Unknown error.');
rsTimeOut:
lbLog.Items.Append('Timed out.');
rsErrorUnreachable:
lbLog.Items.Append(format('Host %s reports destination network
unreachable.',
[IdIcmpClient.ReplyStatus.FromIpAddress]));
rsErrorTTLExceeded:
lbLog.Items.Append(format('Hope %d %s: TTL expired.',
[IdIcmpClient.TTL, IdIcmpClient.ReplyStatus.FromIpAddress]));
end; // case
ERRORS:
[Error] Undeclared identifier: 'TTL'
[Error] Unit1.pas(36): Undeclared identifier: 'ReplyStatus'
[Error] Unit1.pas(36): 'OF' expected but identifier 'ReplyStatusType' found
[Error] Unit1.pas(40): Undeclared identifier: 'ReplyStatus'
I've added idReply to the uses clause, but i still get some of the errors
that i thought it would solve.
Aim
I want to check if a computer is connected to the internet, by pinging a
website like Google or yahoo, if there is a echo then i would know that it
is connected otherwise it's not.
Any suggestions?
Thanks