The DevZest Wiki

Web Database Implementation

Modified: 2011/04/22 11:08 by weifenluo - Categorized as: .Net Licensing
I have application with 3 levels (for example: Standart, Prof. Ultim) and would like have funcionality that one licence will be valid for 2 computers.

Question is, what elements I have store in web database for right licencing functionality?

Here is a typical implementation of .Net Licensing:

1. Your customer makes a purchase of your software, you should create a LicenseKey object:
LicenseKey licenseKey = DevZest.Licensing.LicenseKey.NewLicenseKey();

2. Send the license key string (licenseKey.ToString()) to your customer; at the same time, store this license key string in your web database, together with other order information such as application levels and/or number of licenses. Please note what order information should be stored in web db is your business decision and totally up to you, this data will be used for the next step later.

3. Your customer will call your web service via LicenseClient.GetLicense(...) to get the license (DevZest.Licensing.LicensePublisherResponse.License). Your web service implementation (override of DevZest.Licensing.LicensePublisher.GetLicense(...)) should verify the provided license key against your web db, and generate the License object based on the order information, for example, add different LicenseItem to License.Items based on application levels, throws an exception if more than 2 computers has already got the license, etc. Again, what License object will be returned is your business decision and totally up to you.