简体   繁体   English

如何在 c# 中没有第三方组件的情况下以我的 windows 表单打开 chrome 浏览器?

[英]How to open chrome browser in my windows form without third party component in c#?

I placed the web browser inside the windows form and try to navigate to a URL which was working in chrome, but web browser doesn't allow it to work because it is using IE. I placed the web browser inside the windows form and try to navigate to a URL which was working in chrome, but web browser doesn't allow it to work because it is using IE. How do I change from IE to chrome in web browser control?如何在 web 浏览器控件中从 IE 更改为 chrome?

strURL="http://myurl.com";
try
{
//Launch Chrome in a new window
System.Diagnostics.Process.Start("chrome", strURL+" --new-window");             
}
catch
{
try
{ 
    //Chrome not found ... launch Firefox in a new window
    System.Diagnostics.Process.Start("firefox", "-new-window "+ strURL);
}
catch
{
    //WARN THE USER TO INSTALL A BROWSER...
}
} 

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

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