mos*_*ech 5 .net c# shellexecute
我想使用 shell 可执行文件来尊重要启动的应用程序的用户首选项,但我还需要知道该特定应用程序何时关闭。
Process editProcess = new Process();
ProcessStartInfo startInfo = new ProcessStartInfo();
startInfo.FileName = filename;
startInfo.Verb = "edit";
startInfo.UseShellExecute = true;
editProcess.StartInfo = startInfo;
// start the default editor
editProcess.Start();
editProcess.WaitForExit();
Run Code Online (Sandbox Code Playgroud)
WaitForExit 似乎在 shell 进程退出时返回,而不是在真实进程退出时返回。
有没有比手动解析注册表、找到正确的应用程序来启动并显式启动该应用程序而不执行 shell 更好的方法来了解启动的应用程序何时退出?
| 归档时间: |
|
| 查看次数: |
4825 次 |
| 最近记录: |