首页 > 技术文章 > c# process 获取进程退出码

aoun 2015-11-20 09:36 原文

有两种方式:

1.等待进程退出,会阻塞当前线程

  Process.WaitForExit

2.使用Event,注册进程退出事件

  Process.EnableRaisingEvents = true;
  Process.Exited += new EventHandler(WorkerExited);

推荐阅读