自动化服务器无法在IE8中创建对象,但包含了chrome的条件

Automation Server can't create object in IE8 after including condition for chrome

本文关键字:包含 chrome 条件 创建对象 服务器 IE8 自动化      更新时间:2023-09-26

之前我在做

    <script>
    function fun1(){
       var sh=new ActiveXObject("Wscript.Shell");
       sh.run("''''ntbot''my.exe");
    }
    fun();
    </script>

这个代码没有问题。它很高兴地从IE在客户端机器上执行exe,从chrome i编写的applet运行相同,从我运行exe。我所做的代码修改是

<scipt>
    function testCSS(prop) {
        return prop in document.documentElement.style;
    }
     var isChrome = !!(window.chrome && chrome.webstore && chrome.webstore.install);
     var isIE = /*@cc_on!@*/false || testCSS('msTransform'); 

        function fun2(isIE,isChrome)
        {
            if(isIE){
                var sh=new ActiveXObject("Wscript.Shell");
                sh.Run("''''ntbot''my.exe");
                }if(isChrome){
                appletsource="<APPLET archive='CalciApplet.jar' codebase='/kiss' CODE='AppletGchrome.CalculateApplet.class' WIDTH='0' HEIGHT='0'></APPLET>"
                document.getElementById("appletplace").innerHTML=appletsource;
            }
        }
        fun2(isIE,isChrome);
</script>

不是在Chrome上工作,但不是在IE中,我在IE中得到自动化服务器无法创建对象。

错误请在这件事上帮帮我。谢谢你。

问候,swapnil p .

ActiveX是IE 唯一!它永远不会在Chrome上工作。

自动化服务器不能创建对象意味着activeX的安全设置设置在错误的级别。将您的页面添加到受信任的站点。