Using Activation Service.
Sample written in C#
Sample written in Visual Basic .NET

This sample doesn’t contain Manco.Licensing DLL itself in it, so don’t forget to download main archive from the 'Download - Manco .NET Licensing System' page.

The Activation Web Service is the separate part of Manco .NET Licensing System. It is designed to perform 4 main functions:

  1. Online product activation. Product activation is a technology is used by a number of licensing schemes available today. Manco .NET Licensing System allows you using product activation to bind license to a single computer so that the same license can’t be used on another PC. This operation can be performed manually using License Manager or automatically using Activation Web Service.
  2. Online Activation Key validation. You can configure your application to connect with Activation Web Service to check if the licensing information (license file or Unlock Key) and Activation Key are still valid and stop execution if they aren’t. So if you remove Activation Key or information about purchase from the database your application will not work (in case of money back, for example).
  3. Create licensing information (including license files and unlock keys) in automated mode. Activation Web Service can communicate with e-Commerce systems (like RegNow and ShareIt!) and create licensing information on demand by request from those systems. All necessary information about client and sale can be filled in at this time as well.
  4. Provide functionality for the “License Shop” (Silverlight based tool for complete customer and license management).

In this article we describe how the Activation Web Service can be used for online product activation.

The Activation Web Service uses licensing schema that is similar to the Windows licensing. When you install Windows you enter the License Key that is printed on the sticker. When installation is finished you follow the process of Windows activation. During this process you obtain Activation Key from the Microsoft Activation Service. After that this particular copy of the Windows can work on one PC only.

Licensing scenario with Activation Web Service can be used when you’d like to bind licensed software to particular PC. This scenario limits using of your software with one PC per one License Key/License File bought from you. This schema works as following:

  1. While Unlock Key and Activation Key have not been entered and evaluation time has not been expired application works in the evaluation mode.
  2. If evaluation time is expired then application stop functioning.
  3. When customer buys a license you send licensing information (Unlock Key or license file).
  4. Customer applies licensing information and asks your application for activation. Application sends request to the Activation Web Service. It validates licensing information and generates Activation Key. Depends on the type of request Activation Key will be copied to the application and/or send to the customer by e-Mail.
  5. If both general licensing information (license file or Unlock Key) and Activation Key are valid application becomes fully functional.

Multiple activations for single license file or Unlock Key are allowed. You can specify number of the PCs where same license file or Unlock Key can be used. By default number of the activations allowed is limited by 1 PC.

We suppose that you have read section "Quick Start using Unlock Key licensing schema" already so we will describe only things are specific for the “Unlock Key with Activation” licensing schema.

Activation Web Service can automatically send e-Mail with Activation Key to user. If you’d like to use this functionality you should configure activation letter for product that uses activation schema.

Firstly we should create e-Mail configuration for Activation Letter. Select “e-Mail Configuration” tab in the License Manager. Click Add new e-Mail toolbar button. New e-Mail configuration will be added. Rename it (“My Product activation e-Mail” for example). Most fields on the e-Mail configuration view are good known for most people are using e-Mails in their practice.

Activation e-Mail configuration

Following fields are required:

  1. From – your e-Mail address.
  2. Subject.
  3. SMTP Server – URL or IP address of the SMTP server will be used to send e-Mail.
  4. If your SMTP server requires authentication then you should check “Use SMTP Authentication” checkbox and fill “User” and “Password” fields.

E-Mail template is presented as XSLT description. To send e-Mail you should load XSLT description from the file. Click Load XSLT button button and select XSLT file to load. See Appendix A for structure of XML data passed to the XSLT for transformation.

When all necessary fields will be filled in click Load XSLT button toolbar button to save changes made.

Now select “Products” tab, expand product tile, and select version tile. Switch to the “Letters” tab. Click Load XSLT button toolbar button. In the “Event” column select “LicenseActivated”. In the “e-Mail Config” column select configuration you’ve created.

Version info with Activation Letter specified

The “Unlock Key with Activation” license type can be defined as following:

Unlock Key with Activation license type
  1. Is Evaluation – indicates that license works as evaluation till Activation and Unlock Key will be entered.
  2. Expiration Days – sets number of day till evaluation license expire.
  3. Unlock Key – indicates that unlock key for this product issued by License Manager should be entered to get product fully functional.
  4. Activation Key – indicates that activation key created using PC system info and unlock key (ether in automatic or manual mode) should be entered to get product fully functional.
  5. Write Key To File – indicates that important license information (unlock and activation keys) should be stored in the license protected storage to reuse in future.

Then you should create evaluation license file using this license type. Evaluation license file shouldn’t contain any Unlock or Activation Key (correspondent fields must be empty). Correspondent evaluation sale record could look like the following:

Evaluation license

Pay attention that both: Unlock and Activation Keys are empty. Create license file and add it to your project.

Now you should prepare your product to use Activation Web Service.

Add evaluation window to your project. It could looks like the following:

License Activation Form

Add “OnClick” event handler for the “Activate” button. This handler should set Unlock Key to the license object, obtain product ID and send it to the activation server. In this example we use Task Framework for asynchronous AWS call.

[C#] [Visual Basic]

The evaluation window also should provide properties to get Unlock Key entered by user and Activation Key obtained from the Activation Web Service.

Next, the program needs to check to see the status of the license. If it is evaluation, or not valid, evaluation window needs to be shown that allows the user to input an Unlock Key and activate application.

[C#] [Visual Basic]

Now you application is ready to run. First time you start it you will see evaluation window with fields to enter Unlock and Activation keys and button for product activation. If you simple close this window your application will continue execution in the evaluation mode. You can check this mode using “IsEvaluation” property of the license object. You can enable or disable some functionality or GUI controls based on this status. To get your application fully functional you have to create “Unlock Key” and then activate it.

In the License Manager go to the “License types” tab and click the “Mange sales” button:

License Manager - Version - Manage Sales

Click License Manager - New Sale toolbar button. You will see “Add new sale” window. Enter necessary customer information. Actually it is enough enter customer name and e-Mail, but we would recommend at least First and Last name too. Click License Manager - Search customer toolbar button to perform search of the client through the database:

License Manager - Real Customer

Switch to the “Sale” tab and click License Manager - Generate unlock key toolbar button to generate Unlock Key.

License Manager - Real Sale

Click OK to add new sale.

Multiple activations for single license file or Unlock Key are allowed. You can specify number of the PCs where same license file or Unlock Key can be used. By default number of the activations allowed is limited by 1 PC. You you’d like to change it set correspondent value in the “Allowed” field:

License Manager - Activations Allowed

Your next step depends on if Activation Web Service uses own data service, or share data service with License Manager. In case when AWS and License Manager are using common data service you can simple use Unlock Key have been created to activate your application. If AWS and License Manager use different data services then you should synchronize data before license can be activated. See "Synchronize data with Remote Data Service" section for information how to synchronize data services.


Sample written in C#
Sample written in Visual Basic .NET
Manco .NET Licensing System Home Page