WebBrowser中运行js

mac2022-06-30  26

HtmlElement script = wf.WebBrowser.Document.CreateElement("script"); script.SetAttribute("type", "text/javascript"); script.SetAttribute("text", "function _func(){return document.body.scrollHeight}"); HtmlElement head = wf.WebBrowser.Document.Body.AppendChild(script); var height2 = wf.WebBrowser.Document.InvokeScript("_func");

  

转载于:https://www.cnblogs.com/c-x-a/p/7809373.html

相关资源:WebBrowser执行JS脚本示例
最新回复(0)