protected virtual void linuxrun (string format) {
if (format == null) {
Console.WriteLine ("run param is null");
return;
}
if (format == string.Empty) {
Console.WriteLine ("run param is empty");
return;
}
Console.WriteLine ("运行命令" + format);
var sp = format.Trim ().Split (' ');
var pro = sp[0];
var param = sp.ToList ();
param.RemoveAt (0);
var p = string.Join (" ", param.ToArray ());
var process = System.Diagnostics.Process.Start (pro, p);
Console.WriteLine ("等待进程退出");
process.WaitForExit ();
Console.WriteLine ("进程退出");
}
网友评论