c# 我想检测启动的程序是否已关闭。我目前正在使用命令启动它
Process.Start(Environment.CurrentDirectory + @"\Card Downloader.exe");
有没有人有办法使用不同的启动器来做到这一点?
最佳答案
Process.Start
方法返回 Process实例。在这种情况下,您可以使用一些可用的方法,例如 WaitForExit
或订阅Exited
此过程结束时将触发的事件。
var process = Process.Start(Environment.CurrentDirectory + @"\Card Downloader.exe");
process.Exited += (sender, e) =>
{
// this will be called when the process exists
};
关于c# - 检测启动的进程是否已关闭,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15320836/