Thursday, 15 July 2010

C# process start firefox.exe fires the exited immediately after launch -



C# process start firefox.exe fires the exited immediately after launch -

similar process.start("iexplore.exe") fires exited event after launch.. why?

the -nomerge alternative not seem work firefox.

updated:

here's preview of c# code within console app

static bool exitcalled = false; static string baseurl = <some url display in browser>; var process = new process { startinfo = new processstartinfo { filename = "firefox.exe" arguments = " -url " + baseurl + " -no-remote -p myprofile " } } process.enableraisingevents = true; process.exited += new eventhandler(delegate(object o, eventargs e) { // process has exited console.writeline("exited event called"); console.readline(); exitcalled = true; } process.start(); while (!exitcalled) { thread.sleep(100); }

running piece of code displays "exited event called" message before browser invoked.

that because -nomerge ie specific programme argument, firefox need utilize -no-remote. need pass -p programme argument since not recommend start firefox process default profile. refer next link on starting new firefox instance:

http://kb.mozillazine.org/opening_a_new_instance_of_firefox_with_another_profile

c# firefox

No comments:

Post a Comment