//创建读写管道
SysexecNewpipe(0);
path:="D:\\Program Files\\Analyse.NET\\TSL.exe";
//非阻塞执行,返回进程句柄
hand:= SysExec(path,"tsl",nil,false,code);
//获取SysExec进程所在管道的输出内容
t1:= "";
while t1="" do
begin
t1:= SysexecReadpipe(hand);
end
deRet:= SysexecDeletepipe(hand);
//删除成功,尝试向指定进程所在管道写入内容
if deRet then
begin
try
SysexecWritepipe(hand," datetostr(20221130T)\r\n");
return false;
except
//写入失败,管道删除成功
return true;
end;
end
SysTerminate(code, hand);//终止进程
return false;