【问题标题】:Which browser does Process.Start useProcess.Start 使用哪个浏览器
【发布时间】:2016-05-02 06:57:52
【问题描述】:

我的默认浏览器是谷歌浏览器 在 c# 中,我有 process.start("some url e.g. **.html") 但它仍然在 IE 中打开。 我想知道我们如何知道/控制 process.start 将使用哪个浏览器?

更新: 抱歉,我在这里错过了一点,在我的电脑上 .html 文件与 Chrome 相关联

【问题讨论】:

标签: c# .net browser


【解决方案1】:

您的默认浏览器与您的默认 .html 文件阅读器不同,如果 html 文件是 Process.Start 可能会使用不同的程序打开它。

//opens your default browser
Process.Start("www.google.com"); 
//opens in IE if that's your configured default program for html files.
Process.Start(@"C:\myFile.html");

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-10-13
    • 2014-02-17
    • 1970-01-01
    • 2013-04-28
    • 2018-12-30
    相关资源
    最近更新 更多