unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, IdBaseComponent, IdComponent, IdTCPConnection,
IdTCPClient, IdIcmpClient, ExtCtrls, IdRawBase, IdRawClient;
type
TForm1 =
class(TForm)
Button1: TButton;
Label1: TLabel;
ti: TTimer;
cl1: TIdIcmpClient;
procedure FormShow(Sender: TObject);
procedure Button1Click(Sender: TObject);
procedure tiTimer(Sender: TObject);
procedure cl1Reply(ASender: TComponent;
const AReplyStatus: TReplyStatus);
private
{ Private-Deklarationen }
FReply: TOnReplyEvent;
public
{ Public-Deklarationen }
protected
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.FormShow(Sender: TObject);
begin
ti.Enabled:=false;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
cl1.Ping('
ELW600');
ti.Enabled:=true;
end;
procedure TForm1.tiTimer(Sender: TObject);
begin
label1.Caption:='
error';
end;
procedure TForm1.cl1Reply(ASender: TComponent;
const AReplyStatus: TReplyStatus);
begin
ti.Enabled:=false;
label1.Caption:=aReplyStatus.FromIpAddress;
end;
end.