const
PING_COUNT = 4; // ping的次数
n
var
Icmp: TIdIcmpClient;
nErrPingCount: Integer;
begin
Icmp.Host := '192.168.0.1'; // 客户端IP
for i := 0 to PING_COUNT - 1 do
begin
Icmp.Ping();
if Icmp.ReplyStatus.BytesReceived = 0 then Inc(nErrPingCount)
else Break;
end;
if nErrPingCount > PING_COUNT - 1 then
begin
// 证明没有开机
end;
end;