签署 ActiveX 控件并授予权限的正确方法是什么
我有 IE 的 activex C# 控件。该控件从某个主机下载。控件执行一些需要特殊权限的工作(IE 显示窗口,其中包含我的控件无法在未经许可的情况下执行操作的信息)。我花了很多时间在谷歌上搜索并阅读许多有关类似情况的主题。我明白我必须做以下事情:
1.用强钥匙标志控制组件。
2. 授予装配权限。
我用VS2010工具生成了强密钥。之后我的控件停止在页面上显示(如果不使用签名控件显示是正常的)。我知道 gacutil /cdl,但没有帮助。 我认为授予权限后,控件显示就可以了,但我的意见是错误的。我通过命令 caspol -addgroup 1 -url http://myhostname/myAdditionPathToControlAssembly/control.dll 授予了程序集权限 FullTrust
(关于caspol实用程序描述http://msdn.microsoft.com/en-us/库/cb6t8dtz(v=vs.80).aspx)。 毕竟我的控件没有显示。
签署 ActiveX 控件并授予解决我的问题的权限的正确方法是什么?
I have activex C# control for IE. That contol downloaded from some host. Control does some work that needs special permissions(IE shows window with information that my control cannot do operation without permission). I spend a lot of time googling and reading many topics about similiar situations. I understood that I must do following things:
1. Sign control assembly with strong key.
2. Grant permission to assembly.
I generated strong key with VS2010 tools. After that my control stopped displaying on page(if don't use signing control displaying is normal). I know about gacutil /cdl, it doesn't help.
I decided that after granting permission, control displaying will be OK, but my opinion was wrong. I granted permission for assembly via command caspol -addgroup 1 -url http://myhostname/myAdditionPathToControlAssembly/control.dll FullTrust
(about caspol utility describes http://msdn.microsoft.com/en-us/library/cb6t8dtz(v=vs.80).aspx).
After all my control does not displaying.
What the right way to sign activex control and grant permission to solve my problems?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Internet Explorer 可能会阻止您初始化控件。您需要将该控件标记为脚本安全和初始化安全。此文档介绍了如何。这至少会让你开始。如果您还有其他更详细的问题,请告诉我们。
Internet Explorer is probably preventing you from initializing your control. You'll need to mark the control as Safe for Scripting and Safe for Initialization. This document describes how. That will at least get you started. If you have further, more detailed questions, let us all know.