110,536
社区成员
发帖
与我相关
我的任务
分享
public static IHTMLDocument2 GetIHTMLDocument2ByUrl(string url)
{
SHDocVw.ShellWindows shellWindows = new SHDocVw.ShellWindowsClass();
foreach (SHDocVw.InternetExplorer ie in shellWindows)
{
string filename = ie.FullName.ToLower();
Console.WriteLine(filename);
if (filename.IndexOf(@"internet explorer\iexplore") > 0 && ie.LocationURL == url)
{
return ie.Document as IHTMLDocument2;
}
}
return null;
}