C#启动新进程并等待进程退出

来源:互联网 发布:中国八月经济数据 编辑:程序博客网 时间:2024/05/16 18:04
try            {                Process process = Process.Start(processName);                bool exit = false;                while (true)                {                    exit = process.WaitForExit(100);                    if (exit)                    {                        break;                    }                    System.Threading.Thread.Sleep(100);                }            }            catch (Exception ex)            {                System.Diagnostics.Debug.WriteLine(ex.ToString());            }

0 0
原创粉丝点击