WebBrowser 框架问题。 我用webbrowser获取网页内容时,如果网页存在框架,怎么获取框架里的内容.网上说:webbrowser.document.framers 但是我的怎么点不出来这个 .framers 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 this.webBrowser1.Document.Window.Frames webBrowser1.Document.Window.FrameswebBrowser1.Document.Forms HtmlElement title = webMain.Document.Window.Frames["content3"].Document.GetElementById("topic");怎么这样些好象还是得不到 <iframe src="about:blank" name="content3" id="content3" frameborder="0" scrolling="no"></iframe>里面的值啊. iframe 下有 <input name="topic" id="topic" size="40" maxlength="50" value="" type="text">这个的. 看这篇文章:C#用WebBrowser控件获取Post数据 我是要用webbrowser 获取iframe下的一个input 的控件吗. 你的<iframe src="about:blank" name="content3" id="content3" frameborder="0" scrolling="no"> </iframe> src怎么是about:blank啊? 他的src应该是点吉的时候传过去的吧,这个有关系吗?<a href="user_post.asp" onClick="go_cmdurl('发布日志',this);border_left('TabPage2','left_tab2');" title="发表" target="content3"> 这个是点击的. 如果iframe中包含的网页中有那个按钮的话,你可以这样webBrowser1.Document.Window.Frames["content3"].Document.GetElementById("topic") 那你必须等那个iframe把网页加载了你才可以调用上面的方法 http://blog.tajyw.com/ 注册个blog webBrowser1_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e) { if (e.Url.ToString().Contains("user_post.asp")) { webBrowser1.Document.Window.Frames["content3"].Document.GetElementById("topic").SetAttribute("value", "123456"); }这样写 我试过的 真的可以吗,为什么我每次都 找不到 topic 啊. 汗,原来问题在这,我一直用的是 webbrowser.Url.PathAndQuery 判断的,谢谢兄弟了,总算找到问题所在了. 怎么实现根据应用程序加载时间的进度更新进度条 求助:winform怎么设置字体的间距!! 求C#程序文件在DOS里运行的指令! 用C#如何得到IE网页中的文本框的句柄 用Installshield卸载一个软件 高分请教网络数据传输的数据加密问题 asp.net中能访问mysql数据库吗? 如何用c#在sql server中创建表? dimport不是很理解,哪位来帮忙解释下 winform中如何操作嵌入的Web Browser中的页面元素? 多表插入,如何用事务保证几个表数据的一致? 有一定C#基础.请问我想再学习下.买哪本书自学好呢.
webBrowser1.Document.Forms
怎么这样些好象还是得不到 <iframe src="about:blank" name="content3" id="content3" frameborder="0" scrolling="no"></iframe>
里面的值啊. iframe 下有 <input name="topic" id="topic" size="40" maxlength="50" value="" type="text">这个的.
src怎么是about:blank啊?
{
if (e.Url.ToString().Contains("user_post.asp"))
{
webBrowser1.Document.Window.Frames["content3"].Document.GetElementById("topic").SetAttribute("value", "123456");
}
这样写 我试过的