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.
我想重新启动一个程序。 我找到了进程并调用了 Kill 方法,然后我再次运行它: process.Kill(); 进程.开始();
它停止但不启动。 此外,如果我放置 Exited 事件,它永远不会触发。 有什么问题?
Process.Kill()是异步的。你需要Process.WaitForExit()在调用 kill 后调用。
Process.Kill()
Process.WaitForExit()