Search code examples
c#dllsoftware-designsoftware-protection

How to deactive my dll files using c#


I am buidling dll files for desktop applications (C#/VB.NET).

According to the license with the customers, there is an xml file for expired date for a specific dll file and for a specific function in this dll. My Application uses these dlls to work, I am looking for an idea how to lock/deactivate or prevent the user from using the: 1) the whole dll file (when date is expired) 2) specific function in a dll file. ((when date is expired))


Solution

  • For the whole DLL or for specific function it is the same, if the functions are not grouped in a class u can make the functions at their beginning to check for the date,(u can read this date from XML file) and compare it to current date, if current date is greater than throw an exception....

    If you have in your dll a class that contains all of the functions, than in the constructor of the class check for the date, and throw exception if expired.