使用Active X Control在Javascript中调用.NET库类的方法 [英] Invoking methods from .NET library class in Javascript using Active X Control

查看:83
本文介绍了使用Active X Control在Javascript中调用.NET库类的方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,



我有这个继承抽象类的.NET库类。我找到了几个关于如何使类/方法和属性作为COM对象可见的教程。此外,我能够在系统上注册Active X.



Hello,

I have this .NET library class that inherits an abstract class. I found several tutorials on how to make the class/methods and properties visible as a COM object. Also, I was able to register the Active X on the system.

[ProgId("Class1")]
[ClassInterface(ClassInterfaceType.None)]
[Guid("11EABF82-A840-48AE-B11A-A05DCAFCD0D4")]
[ComVisible(true)] 
public class Class1 : BaseClass {
....
}





对于我的javascript,我能够在类中调用未在抽象类中定义的方法和参数。但是,当我尝试调用抽象类中定义的方法和参数时,我得到不支持对象方法或属性



Ex。



For my javascript, I was able to call methods and parameters in the class that are not defined in the abstract class. However, when I try to call methods and parameters defined in my the abstract class, I get "Object method or property not supported"

Ex.

[ComVisible(true)] 
protected override string Method1() { ... }





有什么方法可以解决这个问题吗?任何帮助,将不胜感激。



先谢谢



Is there any way to fix this? Any help would be appreciated.

Thanks in Advance

推荐答案

客户端大小上使用的ActiveX真的很邪恶。首先,这是专有技术,因此浏览器没有义务支持它,并且通常不会或通过一些许多用户不会安装的插件来做。特别是在非Microsoft平台上。什么,仅为Internet Explorer用户开发应用程序(基本上)?我不会把它叫做网络。



此外,这是出了名的不安全。有文化的用户如果得知您在客户端使用ActiveX,将拒绝使用您的应用程序。使用它违反了本地系统的隔离和隐私,因为原则上,ActiveX组件可以获得与当前用户相同的访问权限。相比之下,标准Web技术是安全的;它们旨在将本地系统与Web应用程序隔离开以保证安全。



因此,我觉得使用它没有任何意义,但是有很多潜在的危害。我建议一定要避免它。



-SA
ActiveX used on the client size is evil, really. First of all, this is proprietary technology, so browsers are not obliged to support it and often don''t or do via some plug-ins which many user''s won''t install. Especially on non-Microsoft platforms. What, developing application only for the users of Internet Explorer (basically)? I would not call it Web.

Also, this is notoriously unsafe. The literate users will deny using your application if they learn that you use ActiveX on client side. Using it violates isolation and privacy of local systems, as, in principle, ActiveX component can get the same access as the current user. In contrast, standard Web technologies are safe; they are designed to isolate local systems from Web application to guarantee safety.

So, I see no sense in using it, but a lot of potential harm. I would advise to avoid it, by all means.

—SA


这篇关于使用Active X Control在Javascript中调用.NET库类的方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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