使用IHTMLWindow2运行javascript [英] Runing javascript using IHTMLWindow2
问题描述
这是我的代码:
Here is my code:
SHDocVw.InternetExplorer ie= new SHDocVw.InternetExplorer();
........
mshtml.HTMLDocument doc = (mshtml.HTMLDocument)ie.Document;
mshtml.IHTMLWindow2 win = doc.parentWindow as mshtml.IHTMLWindow2;
win.execScript("insertUnit($('#unit_input_light')," + 1000+ ")", "javascript");
在我的电脑上(Windows 7)正在运行但是在另一台PC(使用win XP)使用管理员用户抛出此错误:
at mshtml.IHTMLWindow2.execScript(String code,String language)
at Farmator.Form1.trimiteAtac(Int32 s1,Int32 s2)
访问被拒绝。 (HRESULT异常:0x80070005(E_ACCESSDENIED))
我为什么要修复此问题?
On my PC(windows 7) is working but on another PC (with win XP) using an administrator user throw this error:
at mshtml.IHTMLWindow2.execScript(String code, String language)
at Farmator.Form1.trimiteAtac(Int32 s1, Int32 s2)
Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))
Why should i do to fix this ?
推荐答案
('#unit_input_light'), + 1000+ ), javascript);
('#unit_input_light')," + 1000+ ")", "javascript");
在我的电脑上(Windows 7)工作但在另一台PC上(使用win XP)使用管理员用户抛出此错误:
at mshtml.IHTMLWindow2 .execScript(字符串代码,字符串语言)
at Farmator.Form1.trimiteAtac(Int32 s1,Int32 s2)
访问被拒绝。(HRESULT异常:0x80070005(E_ACCESSDENIED) ))
我为什么要这样做呢?
On my PC(windows 7) is working but on another PC (with win XP) using an administrator user throw this error:
at mshtml.IHTMLWindow2.execScript(String code, String language)
at Farmator.Form1.trimiteAtac(Int32 s1, Int32 s2)
Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))
Why should i do to fix this ?
这篇关于使用IHTMLWindow2运行javascript的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!