webbrowser控件中 修改iframe中的body标签
1.html的内容
程序代码:<form id="addReplyForm" method="post"> <fieldset> <iframe id="ifa" style="width:100%;height:100%;border:none;" width="100%" height="100%" frameborder="0" title="kissy-editor" src="2.html" allowtransparency="true"></iframe> </fieldset> </form>
2.html的内容
程序代码:<html contenteditable="true">
<head>
</head>
<body id="editorbodyid">
<p><br></p>
</body>
</html>请问如何用C#编程 用webbrowser控件载入 1.html然后 在webBrowser1_DocumentCompleted事件中 修改2.html中 body里面的内容
我在webBrowser1_DocumentCompleted中写的是
程序代码: if (webBrowser1.ReadyState < )
{
return;
}
HtmlElementCollection a = webBrowser1.Document.All["addReplyForm"].GetElementsByTagName("iframe");
foreach (HtmlElement kk in a)
{
textBox1.Text = kk.GetAttribute("src");
kk.Document.Write("aaaaaaaaaaa");
}结果1.html中的内容被改成aaaaaaaaaaa了






