与有限的权利,动态地装载组件组件、权利、动态

2023-09-06 22:10:50 作者:幸福加载中…

我想收集以下问题的一些信息: 我已经开发了需要管理员权限的应用程序。这与以下行实现清单文件中:

I am trying to gather some information on the following subject: I have developed an application that requires administrator rights. This is achieved with the following line in the manifest file:

<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />

现在我想要做的就是提供一个简单的接口供人们使用,创造了这个应用程序的扩展。这应该被提供作为一个组件将被放置在插件目录。在参加办法将加载它们在动态地。

Now what I would like to do is to provide a simple interface for people to use and create an extension for this application. This should be provided as an assembly an will be placed in the 'Plugins' directory. The appplication will load them in dynamicly.

很明显,我不希望这些组件加载具有管理员权限。

Obviously, I would not want those assemblies to be loaded with administrator rights.

什么是推荐的方式来做到这一点?

What are the recommended ways to do this?

谢谢!

推荐答案

我不太清楚你正在尝试做的,但如果要加载权限有限的组件,创建新的应用领域,并为其分配有限的权限提供一些低权限级别的证据,比如把它在Internet区域。那么你的组件加载到这个领域,它会拥有这些权限较低。

I'm not quite sure what you are trying to do, but if you want to load an assembly with limited rights, create a new application domain and assign it limited permissions by providing some low-permission level evidence, like putting it in the internet zone. Then load your assembly into this domain and it will have those low permissions.

Here's让你开始类似的东西。

Here's something similar to get you started.

这里更多的证据。