简体   繁体   English

Process.Start将不会启动Chrome

[英]Process.Start will not launch chrome

I'm having trouble getting Process.Start to launch chrome. 我在获取Process.Start来启动chrome时遇到问题。 If chrome is set as the default browser - nothing is opened. 如果将chrome设置为默认浏览器,则不会打开任何内容。 I also have tried providing two argument ex: 我也尝试过提供两个参数,例如:

    Process.Start("chrome",url)
    Process.Start("PathToChrome",url)
    Process.Start("chrome.exe",url)

None of those work either. 这些都不起作用。 It works fine when IE or Firefox are the default browser. 当IE或Firefox为默认浏览器时,它可以正常工作。 This same problem has been reproduced on two computers. 同一问题已在两台计算机上重现。

A shot in the dark, but: Since you tagged this question "windows installer", it occurs to me you may have been calling Process.Start() in a custom installer. 黑暗中的一枪,但是:因为您将这个问题标记为“ windows installer”,对我来说,您可能已经在自定义安装程序中调用了Process.Start()。 If so, is the setup project property InstallAllUsers set to true? 如果是这样,安装项目属性InstallAllUsers设置为true? If so, set it to false and Process.Start(someUrl) should work correctly, even if Chrome is the default browser. 如果是这样,请将其设置为false,即使Chrome是默认浏览器,Process.Start(someUrl)也应正常运行。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM