你可以参考以下这段例子代码:private void menuItem3_Click(object sender, System.EventArgs e){
object url="http://www.google.com";
object nothing=System.Reflection.Missing.Value;
this.axWebBrowser1.Navigate2(ref url,ref nothing,ref nothing,ref nothing,ref nothing);
}private void button1_Click(object sender, System.EventArgs e){
try{
mshtml.HTMLDocumentClass doc=(mshtml.HTMLDocumentClass)this.axWebBrowser1.Document;
MessageBox.Show(((mshtml.HTMLInputElementClass)doc.all.item("q",0)).value);
}
catch(Exception ex){
MessageBox.Show(ex.Message.ToString());
}
}在上面的例子中,点击menuItem3以后,webBrowser控件中会装载Google的首页。然后点击button1,就能够从webBrowser控件中读出<input type=text name=q>的控件的当前值。
Hogwarts - S(u)ddenly dis@ppeared...

本贴子以“现状”提供且没有任何担保,同时也没有授予任何权利。具体事项可参见使用条款(http://support.microsoft.com/directory/worldwide/zh-cn/community/terms_chs.asp)。