WebBrowser webBrowser = new WebBrowser();
webBrowser.Navigate(AppDomain.CurrentDomain.BaseDirectory + "/Test.Html");//加載網頁
mshtml.IHTMLDocument2 html = (mshtml.IHtmlDocument2)this.webBrowser.Document.DomDocument;
//mshtml.IHTMLDocument2 html = (mshtml.IHtmlDocument2)this.webBrowser.Document;//此方法在VS2005中不適用
mshtml.IHTMLWindow2 win = (mshtml.IHTMLWindow2)Html.parentWindow;
win.execScript("document.getElementById(''text'').value += trans();", "Javascript");//使用JS
this.richTextBox1.Text += this.webBrowser.Document.GetElementById("text").InnerHtml; //獲取頁面元素值