2013-06-05 75 views
0

我有以下代碼:的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窗口中的「確認」按鈕。一旦點擊該按鈕,程序將繼續執行。

+2

你爲什麼不UseShellExecute''設置爲true? –

回答

0

嘗試

Process objProcess = Process.Start("IEXPLORE.EXE", "-nomerge http://google.com/"); 
+0

非常感謝:)正是我想要的。工程就像一個魅力:) – Augis

+0

你wellcome :) –

相關問題