使用C语言进行编程有什么优势?
- 内容介绍
- 文章标签
- 相关推荐
本文共计401个文字,预计阅读时间需要2分钟。
感觉很久没写模拟器代码了,昨天调试的时候遇到了点墙,记录下来,避免大家再犯同样的错误。+HtmlElement jsElement=webBrowser1.Document.CreateElement(script);
感觉很久不写模拟器代码了,昨天调试的时候碰了点壁,记录下来,避免大家再跟我犯同样的错误。
加入Javascript脚本的地方:
HtmlElement jsElement = webBrowser1.Document.CreateElement("script"); jsElement.SetAttribute("type", "text/javascript"); jsElement.SetAttribute("text", "showMeAction = function(e) { window.alert(e);}"); webBrowser1.Document.Body.AppendChild(jsElement);
调用的地方:
string[] args = new string[1]; args[0] = "Hello element!"; webBrowser1.Document.InvokeScript("showMeAction", args);
大家特别注意的是后面脚本调用的时候,只能出现函数名与参数值列表,不能增加其他内容,否则调用就不会成功。
本文共计401个文字,预计阅读时间需要2分钟。
感觉很久没写模拟器代码了,昨天调试的时候遇到了点墙,记录下来,避免大家再犯同样的错误。+HtmlElement jsElement=webBrowser1.Document.CreateElement(script);
感觉很久不写模拟器代码了,昨天调试的时候碰了点壁,记录下来,避免大家再跟我犯同样的错误。
加入Javascript脚本的地方:
HtmlElement jsElement = webBrowser1.Document.CreateElement("script"); jsElement.SetAttribute("type", "text/javascript"); jsElement.SetAttribute("text", "showMeAction = function(e) { window.alert(e);}"); webBrowser1.Document.Body.AppendChild(jsElement);
调用的地方:
string[] args = new string[1]; args[0] = "Hello element!"; webBrowser1.Document.InvokeScript("showMeAction", args);
大家特别注意的是后面脚本调用的时候,只能出现函数名与参数值列表,不能增加其他内容,否则调用就不会成功。

