如何以编程方式确定的Active X已被禁用,如果一个Active X控件已安装,并且如果一个Active X控件已安装但被禁用? [英] How do I programmatically determine if active x has been disabled, if an active x control has been installed, and if an active x control has been installed but disabled?

查看:471
本文介绍了如何以编程方式确定的Active X已被禁用,如果一个Active X控件已安装,并且如果一个Active X控件已安装但被禁用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用ASP.NET上的客户端服务器端和JavaScript。

I'm using ASP.NET on the server side and javascript on the client side.

我想开发一些网页,这将帮助用户排除故障,我想知道是否有一种方法以编程方式确定以下内容:
1)如果的Active X已在Internet Explorer中禁用
2)如果已经安装了一个Active X控件
3)如果一个Active X控件已安装但被禁用?

I'm trying to develop some pages that will help the user troubleshoot and I was wondering if there was a way to programmatically determine the following: 1) if active x has been disabled in Internet Explorer 2) if an active x control has been installed 3) if an active x control has been installed but disabled?

有关案件2和3,我知道,为了检测已安装的Active X控制,你会在JavaScript中使用下面的检查:

For cases 2 and 3, I know that in order to detect that an active x control is installed, you would use the following check in javascript:

function isActiveXControlInstalled(progId, expectedVersion)
{
    var version;
    try
    {
        var instance = new ActiveXObject(progId);
        version = instance.VersionString;
        instance = null;
    }
    catch (e)
    {
       version = null; // Set version to null, since that is an invalid control version, and the check below will always fail.
    }

    return (version >= expectedVersion);
}

然而,这个功能也返回,所述控制已安装但禁用的情况下假。这两种情况下,可以区分?

However, this function also returns false in the case that the control is installed but disabled. Can these two cases be distinguished?

感谢您的帮助。

推荐答案

没有。我想,如果已安装,但禁用它,你将无法从您的应用程序可讲。你可能会考虑您的故障排除页面改变措辞不安装或已禁用。

No. I think if it is installed but disabled you won't be able to tell from your application. You might consider changing the wording in your troubleshooting page to "not installed or is disabled".

这篇关于如何以编程方式确定的Active X已被禁用,如果一个Active X控件已安装,并且如果一个Active X控件已安装但被禁用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆