How to restrict access to my DLL
Is possible to restrict access to my .NET DLL library? My application has more EXE assemblies and I need share some code, b开发者_运维技巧ut I don't want someone else could use that.
It depends on how much you care. A simple way is to make everything internal and then use friend assemblies to allow your assembly to call it.
http://msdn.microsoft.com/en-us/library/0tke9fxk.aspx
Most things you would do can be defeated, but if someone wants to call, they will figure out a way to do it.
You could make all your APIs internal and expose the other assembly as a friend. This is by no means copy protection though, someone can still dissassemble your assembly.
you can sign your code, and check the signature in the dll I guess. you can use a secret (that can easily engineered from disassemblly of your dll) between the exe and the dll
精彩评论