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

后端 未结 4 1837
死守一世寂寞
死守一世寂寞 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:50

    Have you tried something like concatenating the parameters into the process name instead of passing it separated?

    var processName = "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome";
    var args = "--no-default-browser-check";
    Process.Start(String.Format("{0} {1}", processName, args));
    

提交回复
热议问题