簡體   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. 如何在 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