用INDY的ICMPCLIENT控件
procedure TForm1.Button1Click(Sender: TObject);
begin
IdIcmpClient1.Ping('192.168.0.1');
end;
procedure TForm1.IdIcmpClient1Reply(ASender: TComponent;
const AReplyStatus: TReplyStatus);
begin
Memo1.Lines.Add(Format('Reply from %s: bytes=%d time %d ms TTL=%d',
['192.168.0.1', AReplyStatus.BytesReceived, AReplyStatus.MsRoundTripTime, AReplyStatus.TimeToLive]));
end;