简体   繁体   English

使用代码中的 URL 启动 Microsoft Edge

[英]Launching Microsoft Edge with URL from code

I need to launch the Microsoft Edge browser with a specific URL from ac# application.我需要使用来自 ac# 应用程序的特定 URL 启动 Microsoft Edge 浏览器。 How can I do that?我怎样才能做到这一点? What's the best way to retrieve the path where Microsoft Edge is installed and call it passing the appropriate arguments?检索安装 Microsoft Edge 的路径并通过适当的参数调用它的最佳方法是什么? I would like to launch it directly without installing any webdriver.我想直接启动它而不安装任何网络驱动程序。

I saw this How to open URL in Microsoft Edge from the command line?我看到了如何从命令行在 Microsoft Edge 中打开 URL? but couldn't make it work from code.但无法通过代码使其工作。

Thanks.谢谢。

I figured that out.我想通了。

You can call the browser by using microsoft-edge:http://www.yoursite.com from the command line.您可以从命令行使用microsoft-edge:http://www.yoursite.com调用浏览器。

Process.Start("microsoft-edge:http://www.yourpage.co.uk");

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

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