WinForm 如果获取当前IE程序中的地址栏中的URL地址。

moonlover 2011-10-08 09:25:04
如题,在网上看到
System.Diagnostics.Process[] _List = System.Diagnostics.Process.GetProcessesByName("iexplore");

然后用
[DllImport("user32.dll")]
public static extern int EnumChildWindows(IntPtr hWndParent, EnumWindowsProc ewp, int lParam);
获取到地址栏 就可以了


但不太懂,求解释
...全文
100 1 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
全局变量 2011-10-08
  • 打赏
  • 举报
回复
SHDocVw.ShellWindows shellWindows = new SHDocVw.ShellWindowsClass();
String filename = null;
string IEUrl = "";
foreach (SHDocVw.InternetExplorer ie in shellWindows)
{
filename = Path.GetFileNameWithoutExtension(ie.FullName).ToLower();
if (filename.Equals("iexplore"))
{
string tempUrl=ie.LocationURL;
}
}

111,097

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • AIGC Browser
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧