![]() The constructor takes connection string to licenses database, a bool value telling whether to use MySQL and the version of MySQL (if it is used), just like the LicensingClient constructor, but without specifying product name. LicenseValidator doesn't deal with registry, so admin permissions aren't needed. If you have your own database hosted there, replace values in the connection string with the values in email they will send you. This service is used because it's free and easy to use. If you run the code above, it will connect to my own database hosted on FreeSQLDatabase. The inaccessible registry key will be stored in the exception data under key InaccessibleRegistryKey. If they aren't provided, a RegistryAccessException will be thrown. Please note that LicensingClient opens a registry key in the constructor, and thus it needs admin permissions. The decision will depend on the license configuration in registry (see below how to configure a license easily) and on its usability ( LicensingClient looks up in the database to find out whether the configured activation key is valid). It will decide whether to run the full app version or a message "Not licensed". Then we need to start a LicensingClient in the main method. ![]() Get a connection string and go to the next step. ![]() After creating your database will of course be empty, but this library will automatically set it up. You may use any database hosting from Windows Azure to FreeSQLDatabase (uses MySQL 5.0.12). This library supports MS SQL Server and MySQL. Say, we have an app that isn't completely free, and we want to sell licenses for it and activate it through activation keys.įirst, we need a database to store licenses. It's good for quick start, but for commercial use you'd better host a database yourself, e.g. You don't even need to set up a database. ![]() It will display the parameters you initially entered in Admin.cs's CLI. View the current license using Client.cs.Take down the key of the created license.Run Admin.cs and create a license using its CLI.Download Admin.cs and Client.cs, compile them into console apps and: You can test this library by using the ready code examples in folder examples. You can also clone this repository (or download it using the green "Code" button), compile it and add a reference to the compiled assembly in your project. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |