Looking for a locked down script interpreter [closed]

元气小坏坏 提交于 2019-12-06 02:30:50

In other words, you need to sandbox the execution of your script.

There is a native .NET mechanism which allows you to do that: AppDomain permissions.

Have a look at How to: Run Partially Trusted Code in a Sandbox

However, that will not be enough if you want to implement machine resource-specific restrictions (memory and CPU). An arguably simple way to run your code in a restricted AppDomain AND to limit machine resources consumption would be to use the Managed AddIn framework, and particularly its AddInProccess class (see Managing Add-Ins: Advanced Versioning and Reliable Hosting, Machine Resource Exhaustions section).

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!