首页 > 解决方案 > How to get Microsoft Edge instance from C#.Net

问题描述

How can I detect Microsoft Edge instances from C#.Net ?Currently my application is using below code to detect IE11 instances .

var FoundBrowsers = new SHDocVw.ShellWindows();
foreach (SHDocVw.InternetExplorer browser1 in FoundBrowsers)
    {
        if (browser1.LocationURL.ToUpper().Contains("SAMPLETEXT"))
            {
                return browser1;
            }
     }
return null;

How do I replace this to access MS edge instances ?

标签: c#

解决方案


我不认为像 IE 那样通过代码直接控制是可能的。您将需要将 chromedriver 用于控制器边缘(基于铬)。

如果您只是想将网页嵌入到您的应用程序中,您可以使用 Edge 的 WebView2 来实现。


推荐阅读