Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
[navy][i]// for automatic syntax highlighting see faq102-6487
[/i][/navy]
[b]unit[/b] IPVerify;
[b]interface[/b]
[b]uses[/b]
IdBaseComponent, IdComponent, IdRawBase, IdRawClient, IdIcmpClient,
Windows, Messages, Classes, SysUtils;
[b]function[/b] IPExists(IPAddr: String): Bool;
[b]implementation[/b]
[b]function[/b] IPExists(IPAddr: String): Bool;
[b]var[/b]
I: TIdIcmpClient;
Rec: Integer;
[b]begin[/b]
Result:= False;
I:= TIdIcmpClient.Create([b]nil[/b]);
[b]try[/b]
I.Host:= IPAddr;
I.Ping();
Sleep([navy]2000[/navy]);
Rec:= I.ReplyStatus.BytesReceived;
[b]if[/b] Rec > [navy]0[/navy] [b]then[/b] Result:= True [b]else[/b] Result:= False;
[b]finally[/b]
I.Free;
[b]end[/b];
[b]end[/b];
[b]end[/b].