C# IE浏览器
2021-05-01 18:27
标签:mic process window es2017 www. 显示 soft .sh htm 引用Microsoft HTML Object Library 引用 -> com -> Microsoft HTML Object Library 引用后,显示如图 1.判断ie浏览器是否已经打开了指定Url 2.在当前ie进程中添加新tab,打开指定Url 直接启动新的ie进程,也是可以的 Process.Start("iexplore.exe", “www.baidu.com"); C# IE浏览器 标签:mic process window es2017 www. 显示 soft .sh htm 原文地址:http://www.cnblogs.com/kybs0/p/7783477.html SHDocVw.ShellWindows shellWindows = new SHDocVw.ShellWindows();
bool hasCurrentUrl = false;
foreach (SHDocVw.InternetExplorer browser in shellWindows)
{
if (string.IsNullOrEmpty(browser.FullName))
{
continue;
}
string filename = Path.GetFileNameWithoutExtension(browser.FullName).ToLower();
if (filename.Equals("iexplore") && browser.LocationURL.Contains(webUri))
{
hasCurrentUrl = true;
break;
}
}
SHDocVw.InternetExplorer webBrowser1 = (SHDocVw.InternetExplorer)shellWindows.Item(shellWindows.Count - 1);
webBrowser1.Navigate(webUri);