开发者

Plugin examples [closed]

开发者 https://www.devze.com 2023-02-14 22:38 出处:网络
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references,or expertise, but this question will likely solicit debate, a
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 10 years ago.

I'm creating a web-relat开发者_如何学Pythoned application and I want to add plugin support to it. But I want the plugin dlls to be restricted from everything except my SaveSettings(), RequestPage() and SendToHost() methods. Any good examples how to do that?


You can require your plugins to implement an interface which contains those three methods. In your code then you would call those methods where it is necessary to apply the plugin functionality.

Of course this will not prevent them from executing code within those methods that is not desirable. This becomes more of a security problem in this case. I can't think of a straightforward way of doing this except to load the plugin assemblies into another AppDomain and set security restrictions on the AppDomain about what they can do. This will also of course complicate how you pass data between your plugin and your code.

0

精彩评论

暂无评论...
验证码 换一张
取 消