Using Licensing Service Methods in .NET

The .NET CPS dll component currently has pre-made forms for license validation and activation, but what if you want more control with your own forms?

 

Fortunately there are service methods that can be called directly from your code to activate, validate and deactivate licenses for your software users.

 

The benefits of using these custom service methods are:

  1. Use your own forms that exactly match your app with design and feel.
  2. Control when activate, validate and deactivate are called so that the architecture of your app is clean.
  3. Use from any .NET based application.  You can now use CPS in any .NET based app.

The CpsService has the following methods implemented from the interface ICpsService:

  • CpsServiceResult Activate(string email, string transactionId, string fullname);
  • CpsServiceResult Deactivate();
  • CpsServiceResult Validate();

The CpsServiceResult class has 2 properties:

  • Result (bool)
  • Description (string)

Here’s an example of using the Validate method

var cpsService = new CpsService();
var cpsServiceResult = new CpsServiceResult();
cpsServiceResult = cpsService.Validate();
There is an example of the custom Activate function in the latest sample .NET app you can download from the members area.