(Gast)
n/a Beiträge
|
AW: Vorstellung und Frage
28. Dez 2014, 21:50
Den Hildebrandt auf Sat1 habe ich schon mal gesehen, daher
Delphi-Quellcode:
unit Unitpingtest;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
ShellApi,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
Edit1: TEdit;
Button1: TButton;
procedure Button1Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
var
batname: string;
procedure TForm1.Button1Click(Sender: TObject);
var
s: string;
f: Textfile;
begin
assignfile(f, batname);
rewrite(f);
s := ' @echo off';
writeln(f, s);
s := ' ping' + #32 + Edit1.text;
writeln(f, s);
s := ' pause';
writeln(f, s);
closeFile(f);
Shellexecute( handle, ' open', PChar(batname), ' ', ' ', sw_show);
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
Edit1.Text := ' 127.0.0.1';
batname := ' e:\pingping.bat';
end;
end.
MfG
|
|
Zitat
|