How to use Process.Start() or equivalent with Mono on a Mac and pass in arguments

后端 未结 4 1834
死守一世寂寞
死守一世寂寞 2020-12-03 02:53

I am trying to write some c# code to start a browser using Process.Start(app,args); where apps is the path to the browser e.g. /Applications/Google Chrome

4条回答
  •  再見小時候
    2020-12-03 03:40

    Why dont you try something like this:

    Process P = new Process();                        
    P.StartInfo.FileName = "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome";
    P.StartInfo.Arguments = "--no-default-browser-check";
    P.UseShellExecute = false;            
    P.Start();
    

提交回复
热议问题