我有以下代碼:的Process.Start拋出「系統找不到指定文件」
var process = new Process
{
StartInfo = { FileName = "http://www.myurl.com", UseShellExecute = false }
};
process.Start(); <-- here exception
process.WaitForExit();//waits while process is finished
//continues to execute
出於某種原因,它會拋出「系統找不到指定文件」的錯誤。 我想要做的是在process.Start()被調用後,IE窗口被打開。程序等待,直到用戶點擊IE窗口中的「確認」按鈕。一旦點擊該按鈕,程序將繼續執行。
你爲什麼不UseShellExecute''設置爲true? –