4
我想使用shell可執行文件來尊重要啓動的應用程序的用戶首選項,但是我也需要知道該特定應用程序何時關閉。ProcessStartInfo.UseShellExecute = true並正在等待進程退出
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();
WaitForExit似乎在shell進程退出時返回,而不是在真實進程退出時返回。
有沒有更好的方式知道什麼時候啓動的應用程序退出比手動解析註冊表,找到正確的應用程序啓動並顯式啓動該應用程序而無需執行shell?
我有類似的問題。你設法解決這個問題嗎? – 2013-09-05 17:37:45