自动执行html里的javascript

自动执行html里的js
   using mshtml;

   IHTMLDocument2 HTMLDocument =(IHTMLDocument2) axWebBrowser1.Document;
   mshtml.IHTMLWindow2 win = HTMLDocument.parentWindow;
   string strScript = "onsubmit(3)";
   win.execScript(strScript, "javascript");

   或者
   ((mshtml.HTMLDocumentClass)axWebBrowser.Document).parentWindow.execScript( "func()", "JScript" );

你可能感兴趣的:(JavaScript)