.NET 4.0 - setting access permissions to file system for dll functions
In my application, users can dynamically load their dll files and run functions from the dll. I want to prevent their code from accessing the fil开发者_开发技巧e system (read/write to local files).
Is it possible?
Have a look at AppDomain
( http://msdn.microsoft.com/en-us/library/bb763046.aspx) and the FileIOPermission
( http://msdn.microsoft.com/en-us/library/system.security.permissions.fileiopermission.aspx).
Yes this is possible.
take a look at this link, it will tell you what you need to know to get started.
http://msdn.microsoft.com/en-us/magazine/ee677170.aspx
精彩评论