111,129
社区成员
发帖
与我相关
我的任务
分享
string a = textBox1.Text;
HtmlDocument hd = this.webBrowser1.Document;
HtmlElement he = hd.GetElementById("kw");
HtmlElement he2 = hd.GetElementById("su");
he.SetAttribute("value",a);
HtmlElement ele = hd.GetElementById("su");
ele.InvokeMember("Click");
HTMLDocument doc = (HTMLDocument)webBrowser1.Document.DomDocument;
object index = 1;
IHTMLWindow2 frame1 = (IHTMLWindow2)doc.frames.item(ref index);
HTMLDocument doc1 = (HTMLDocument)frame1.document;
IHTMLElement title_txt = (IHTMLElement)doc1.getElementById("kw");
//IHTMLElement body_txt = (IHTMLElement)doc1.getElementById("su");
IHTMLElement button_tj = (IHTMLElement)doc1.getElementById("su");
//if (title_txt == null || button_tj == null)
// return;
title_txt.setAttribute("value", this.textBox1.Text, 0);
//body_txt.setAttribute("value", this.richTextBox1.Text, 0);
button_tj.click();
HTMLDocument doc = (HTMLDocument)webBrowser1.Document.DomDocument;
object index = 1;
IHTMLWindow2 frame1 = (IHTMLWindow2)doc.frames.item(ref index);
HTMLDocument doc1 = (HTMLDocument)frame1.document;
IHTMLElement title_txt = (IHTMLElement)doc1.getElementById("kw");
//IHTMLElement body_txt = (IHTMLElement)doc1.getElementById("su");
IHTMLElement button_tj = (IHTMLElement)doc1.getElementById("su");
title_txt.setAttribute("value", this.textBox1.Text, 0);
button_tj.click();


<form id="form1" runat="server">
<meta http-equiv=Content-Type content=text/html;charset=gb2312>
<div>
<frameset rows="64,*" frameborder="NO" border="0" framespacing="0">
<frame src="Default10.aspx" noresize="noresize" frameborder="NO" name="topFrame" scrolling="no" marginwidth="0" marginheight="0" target="main" />
<frameset cols="200,*" rows="560,*" id="frame">
<frame src="Default9.aspx" name="leftFrame" noresize="noresize" marginwidth="0" marginheight="0" frameborder="0" scrolling="no" target="main" />
<frame src="Default7.aspx" name="main" marginwidth="0" marginheight="0" frameborder="0" scrolling="auto" target="_self" />
</frameset>
</div>
</form>