美文网首页
csharp linuxrun

csharp linuxrun

作者: 大地缸 | 来源:发表于2020-12-26 14:06 被阅读0次
    
        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 ("进程退出");
        }
    
    

    相关文章

      网友评论

          本文标题:csharp linuxrun

          本文链接:https://www.haomeiwen.com/subject/quhgnktx.html