Frage

I have following code:

        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

For some reason it throws "The system cannot find the file specified" error. What I want to do is after process.Start() is called, IE window is opened. Program waits, till user clicks "Confirm" button in IE window. As soon as this button clicked, program continues to execute.

War es hilfreich?

Lösung

try

Process objProcess = Process.Start("IEXPLORE.EXE", "-nomerge http://google.com/");
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top