procedure TForm1.FormCreate(Sender: TObject);
begin
Memo1.Lines.Clear;
end;procedure TForm1.Button1Click(Sender: TObject);
var
Host:string;
begin
Host:=Edit1.Text;
tempfile:='c:\tempfile.txt';
if fileexists(tempfile) then
DeleteFile(tempfile);
WinExec(pchar('command.com /C net time \\'+Host+'>'+tempfile),SW_HIDE);
try
if not FileExists(tempfile) then
sleep(3000);
Memo1.Lines.LoadFromFile(tempfile);
except
end; end;procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);
begin
if FileExists(tempfile) then
DeleteFile(tempfile);
end;
begin
Memo1.Lines.Clear;
end;procedure TForm1.Button1Click(Sender: TObject);
var
Host:string;
begin
Host:=Edit1.Text;
tempfile:='c:\tempfile.txt';
if fileexists(tempfile) then
DeleteFile(tempfile);
WinExec(pchar('command.com /C net time \\'+Host+'>'+tempfile),SW_HIDE);
try
if not FileExists(tempfile) then
sleep(3000);
Memo1.Lines.LoadFromFile(tempfile);
except
end; end;procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);
begin
if FileExists(tempfile) then
DeleteFile(tempfile);
end;
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货