c# - 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 ?
解决方案
我不认为像 IE 那样通过代码直接控制是可能的。您将需要将 chromedriver 用于控制器边缘(基于铬)。
如果您只是想将网页嵌入到您的应用程序中,您可以使用 Edge 的 WebView2 来实现。
推荐阅读
- reactjs - MaterialUI 设置网格项目的宽度和间距(例如一行有 10 个项目)
- typescript - 是否可以在没有 forkJoin 或 combineLatest 的情况下访问管道变量?
- firebase - 此 Firebase 信息消息是否会导致问题?
- c# - 从文件路径返回网络名称
- animation - A-Frame Animation-mixer 在特定时间帧开始动画
- python - VSCode Code Runner 不遵循 settings.json
- php - 访问此数组数据
- javascript - AsyncStorage 没有在 ReactNative 中保留我的用户数据
- linux - 如何使我的电子应用程序可在 Linux 上安装
- linux - 创建目录列表打印机