LicenseManager 2.0.0

dotnet add package LicenseManager --version 2.0.0                
NuGet\Install-Package LicenseManager -Version 2.0.0                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="LicenseManager" Version="2.0.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add LicenseManager --version 2.0.0                
#r "nuget: LicenseManager, 2.0.0"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install LicenseManager as a Cake Addin
#addin nuget:?package=LicenseManager&version=2.0.0

// Install LicenseManager as a Cake Tool
#tool nuget:?package=LicenseManager&version=2.0.0                

LicenseManager for WooCommerce .Net Library

NuGet NuGet Downloads Deploy to NuGet

An unofficial C# Library for the LicenseManager for WooCommerce (formerly known as LicenseManager.at). This library makes it easy to activate or validate software licenses from .Net applications.

Install the package using Nuget

Get the library from NuGet.

PM> NuGet\Install-Package LicenseManager

Examples

Minimal usage example for License Activation

For more information/details take a look at the example projects.

// 1. Create a new instance of license manager client

var baseUrl = "https://licensemanager.codelu.eu/";
var consumerKey = "ck_a0625b314db9ab7f44d4c29ac93aab416aa8ef8e";
var consumerSecret = "cs_37abbda659e5932b286546890322d2fd55e9e298";

// Set the culture (language) for the license checking messages
var cultureInfo = new CultureInfo("en");
//var cultureInfo = new CultureInfo("de");
//var cultureInfo = new CultureInfo("es");
//var cultureInfo = new CultureInfo("fr");
//var cultureInfo = new CultureInfo("ru");
//var cultureInfo = new CultureInfo("zh");

var client = new LicenseManagerClient(baseUrl, consumerKey, consumerSecret, productId, cultureInfo);

// 2. Activate a license key (this will increase the TimesActivated counter if successful)
// This can is useful when the license should only be used e.g. on one computer
var licenseKey = "MY-LICENSE-KEY";
LicenseKeyResponse activateLicenseResponse = await client.ActivateLicenseAsync(licenseKey);

// 3. Check the LicenseKeyResponse
// This returns a CheckLicenseResponse object indicating the success or failure of the activation check.
// That response also include the localized message
LicenseCheckResponse checkResponse = client.CheckLicenseActivation(activateLicenseResponse, licenseKey);

if (checkResponse.Success) 
{
  // Our license is activated and passed the check!
  Console.Log(checkResponse.Message);

  // For example: Now track that the software is activated in your program and show/unlock the user interface
  Properties.Settings.Default.Activated = true;
  Properties.Settings.Default.Save();
  ShowMyUI();
} else {
  // Our license could not be activated!
  Console.Log(checkResponse.Message);
  return;
}

Minimal usage example for License Validation

For more information/details take a look at the example projects.

// 1. Create a new instance of license manager client

var baseUrl = "https://licensemanager.codelu.eu/";
var consumerKey = "ck_a0625b314db9ab7f44d4c29ac93aab416aa8ef8e";
var consumerSecret = "cs_37abbda659e5932b286546890322d2fd55e9e298";

// Set the culture (language) for the license checking messages
var cultureInfo = new CultureInfo("en");
//var cultureInfo = new CultureInfo("de");
//var cultureInfo = new CultureInfo("es");
//var cultureInfo = new CultureInfo("fr");
//var cultureInfo = new CultureInfo("ru");
//var cultureInfo = new CultureInfo("zh");

var client = new LicenseManagerClient(baseUrl, consumerKey, consumerSecret, productId, cultureInfo);

// 2. We have previously activated our license for this product / computer
// In the activation example we stored that information inside Properties.Settings.Default.Activated.
// So we could for example check if the product is activated using that information.
if (!Properties.Settings.Default.Activated) 
{
  Console.Log("This product is not activated yet! Please activate it first!");
  return;
}

// 3. Validate the license
var licenseKey = "MY-LICENSE-KEY";
LicenseValidationResponse licenseResponse = await client.ValidateLicenseAsync(licenseKey);

// 4. Check if the validation was successful
// This returns a CheckLicenseResponse object indicating the success or failure of the activation check.
// That response also include the localized message
LicenseCheckResponse checkResponse = client.CheckLicenseValidation(licenseResponse, licenseKey);

if (checkResponse.Success) 
{
  // Our license is passed the check!
  Console.Log(checkResponse.Message);

  // For example: Now track show/unlock the user interface
  ShowMyUI();
} else {
  // Our license could not be activated!
  Console.Log(checkResponse.Message);
  return;
}

Console Example

The project also contains a console application project which shows how to use every library function. Console Example

WinForms Example

The project also contains a WinForms GUI project which shows and visualizes the basic functionality. WinForms Example

Overview

The library includes the following functionality

  • Activate License (with License object as parameter)
  • Activate License (with license key as a string parameter)
  • Check License Activation
  • Check License Validation
  • Create Generator
  • Create License
  • Deactivate License (with License object as parameter)
  • Deactivate License (with license key as a string parameter)
  • Generate Generator*
  • List Generators
  • List Licenses
  • Ping Products*
  • Update Products*
  • Retrieve Generator
  • Retrieve License
  • Update Generator
  • Update License
  • Validate Customer's Licenses*
  • Validate License (with License object as parameter)
  • Validate License (with license key as a string parameter)

*It seems like these API endpoints are only available with the newly introduced pro version of the WordPress plugin.

LicenseManager Overview

Contributors

<a href="https://github.com/g4m3r0/LicenseManager-for-WooCommerce-.Net-Library/graphs/contributors"> <img src="https://contrib.rocks/image?repo=g4m3r0/LicenseManager-for-WooCommerce-.Net-Library" /> </a>

Made with contrib.rocks.

Product Compatible and additional computed target framework versions.
.NET net5.0 is compatible.  net5.0-windows was computed.  net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 is compatible. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 is compatible. 
.NET Framework net461 is compatible.  net462 is compatible.  net463 was computed.  net47 is compatible.  net471 is compatible.  net472 is compatible.  net48 is compatible.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
2.0.0 422 5/25/2023
1.0.7 346 1/16/2023
1.0.6 260 1/16/2023
1.0.5 279 12/22/2022
1.0.4 515 6/24/2022
1.0.3 409 6/21/2022
1.0.0 428 6/21/2022