简体   繁体   中英

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. How do I change from IE to chrome in web browser control?

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...
}
} 

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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