Launch Web URL in NON-default browser

后端 未结 2 1119
温柔的废话
温柔的废话 2020-12-12 02:05

I know that this:

Process.Start(\"http://www.somewebsite.com/\");

launches a webpage in the users default browser. But, I am creating a use

相关标签:
2条回答
  • 2020-12-12 02:31

    I did that some time ago, just use:

    string browser = "chrome.exe";
    //string browser = "firefox.exe";
    //...
    
    Process myProcess = new Process();
    myProcess.StartInfo.UseShellExecute = true;
    myProcess.StartInfo.FileName = browser;
    myProcess.StartInfo.Arguments = "\"" + url + "\"";
    myProcess.Start();
    
    0 讨论(0)
  • 2020-12-12 02:32
    Process.Start(@"C:\Program Files\Mozilla Firefox\firefox.exe", "http://www.somewebsite.com/");
    

    See also:
    Firefox command line options
    MSDN page for Process.Start

    0 讨论(0)
提交回复
热议问题