[英]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. 如何在 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.