1,593
社区成员
发帖
与我相关
我的任务
分享
procedure TForm1.DosCommand1NewLine(Sender: TObject; NewLine: String;
OutputType: TOutputType);
begin
if OutputType=otEntireLine then
log( '>'+ NewLine)
else
log( '<'+ NewLine);
end;
procedure TForm1.DosCommand1NewLine(Sender: TObject; NewLine: String;
OutputType: TOutputType);
begin
if OutputType=otEntireLine then
log( '>'+ NewLine)
else
log( '<'+ NewLine);
end;
procedure TForm1.BtnRunCmdClick(Sender: TObject);
begin
BtnRunCmd.Enabled:=false;
CBlockout.Enabled:=false;
DosCommand1.CommandLine:=Edit1.Text;
log('[Begin:'+Edit1.Text);
//Memo1.Visible:=false;
if self.CBlockout.Checked then
Memo1.Lines.BeginUpdate;
application.ProcessMessages;
DosCommand1.Execute;
end;
procedure TForm1.DosCommand1Terminated(Sender: TObject);
begin
if self.CBlockout.Checked then
Memo1.Lines.EndUpdate;
//Memo1.Visible:=true;
log('End]');
BtnRunCmd.Enabled:=true;
CBlockout.Enabled:=true;
end;
procedure TForm1.log(const s: String);
begin
Memo1.Lines.Add(formatdatetime('hh:nn:ss.zzz|',now)+s);
end;
procedure TForm1.BtnInputClick(Sender: TObject);
begin
DosCommand1.SendLine(Einput.Text,CBreturn.Checked);
end;