通过WebBrowser 如何打开frame中激活的链接

yemces 2010-10-28 07:03:27
本人用的是 url = webBrowser1.Document.Window.Frames["right"].Document.ActiveElement.GetAttribute("src");
但是取到的url总是空.
...全文
68 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
  • 打赏
  • 举报
回复
设置断点跟踪调试吧
yemces 2010-11-01
  • 打赏
  • 举报
回复
上面那种方法不行的,很耗费资源,而且最终什么都获取不到.....
wuyq11 2010-10-28
  • 打赏
  • 举报
回复
HTMLDocument doc = (HTMLDocument)wb.Document.DomDocument;
object index = 1;
IHTMLWindow2 frame1 = (IHTMLWindow2)doc.frames.item(ref index);
HTMLDocument doc1 = (HTMLDocument)frame1.document;

HTMLDocument doc = (HTMLDocument)webBrowser1.Document.DomDocument;
object j;
for (int i = 0; i < doc.parentWindow.frames.length; i++)
{
j = i;
HTMLWindow2Class frame = doc.parentWindow.frames.item(ref j) as HTMLWindow2Class
}

111,129

社区成员

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

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

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