HtmlElement script = webBrowser.Document.CreateElement("script"); script.SetAttribute("type", "text/javascript"); script.SetAttribute("text", "function _func(){alert(‘OK‘)}"); HtmlElement head = webBrowser.Document.Body.AppendChild(script); webBrowser.Document.InvokeScript("_func");
webbroswer 后台注入脚本
时间: 2024-10-11 18:01:59