I’m interested to find out whether there are any standards or resources that you can recommend for developing license models in C#?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
In C# you can use the Licensing class supplied by Microsoft. A sample is available through the link.
Basically you create a class that inherits from LicenseProvider and type the
as an attribute to your class that you would like to have licensed. In your implementation (
MyControlLicenseProvider) you can code the appropriate methods for validating the license to your needs and then have your code callIf license is not null your application/control is licensed.
As Sir Graystar states, no system is fool-proof, and someone with the needed skills could engineer themselves around your validation. Don’t spend too many hours implementing a rock hard system, but don’t make it to easy to circumvent either. 🙂
Using a hash like SHA or one of the MD hash functions and feed them some key data could be used to create a simple validation check. Your validation method could do something in the likes of
This method returns a custom License, one that for instance has properties regarding the licensing, like a DateTime for the time when licensing runs out. Setting this up should not take to long, it works well with both WinForms and on ASP.NET sites, and will thwart (with no guarantee implied) a simple attempt to break your licensing.