unit Unit3;
interface
uses
Winapi.Windows,
Winapi.Messages, System.SysUtils, System.Variants, System.Classes,
Vcl.Graphics,
Vcl.Controls,
Vcl.Forms,
Vcl.Dialogs, IdIcmpClient, IdBaseComponent,
IdComponent, IdRawBase, IdRawClient,
Vcl.StdCtrls;
type
TForm3 =
class(TForm)
Button1: TButton;
IdIcmpClient: TIdIcmpClient;
procedure IdIcmpClientReply(ASender: TComponent;
const AReplyStatus: TReplyStatus);
procedure Button1Click(Sender: TObject);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
var
Form3: TForm3;
implementation
{$R *.dfm}
procedure TForm3.Button1Click(Sender: TObject);
begin
IdICMPClient.ReceiveTimeout := 5000;
// Timeout 5000 ms
//IdICMPClient.Host := edtAddress.Text;
IdICMPClient.Host := '
172.17.1.130';
IdICMPClient.Ping();
end;
procedure TForm3.IdIcmpClientReply(ASender: TComponent;
const AReplyStatus: TReplyStatus);
begin
ShowMessage('
Received ' + IntToStr(AReplyStatus.BytesReceived) + '
' +
'
Bytes from ' + AReplyStatus.FromIpAddress + '
' +
'
after ' + IntToStr(AReplyStatus.MsRoundTripTime) + '
ms.');
end;
end.