Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
假设我使用 Process.Start(); 创建了一个进程。
在不冻结应用程序的情况下,我如何判断它是否已关闭/终止?
尝试以下
Process p = Process.Start(...); p.Exited += OnProcessExited; private void OnProcessExited(object sender, EventArgs e) { // Put code here }
不过,这段代码有一个问题。Process在附加事件处理程序之前退出是可能的。Process因此,对于快速退出 的 a,您可能不会收到此事件。
Process