LicenseManager 2.0.0
dotnet add package LicenseManager --version 2.0.0
NuGet\Install-Package LicenseManager -Version 2.0.0
<PackageReference Include="LicenseManager" Version="2.0.0" />
paket add LicenseManager --version 2.0.0
#r "nuget: LicenseManager, 2.0.0"
// 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
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.
WinForms Example
The project also contains a WinForms GUI project which shows and visualizes the basic functionality.
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.
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 | Versions 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. |
-
.NETCoreApp 3.1
- System.ComponentModel.Annotations (>= 5.0.0)
- System.Management (>= 6.0.1)
-
.NETFramework 4.6.1
- System.ComponentModel.Annotations (>= 5.0.0)
- System.Management (>= 6.0.1)
- System.Net.Http (>= 4.3.4)
- System.Text.Json (>= 6.0.5)
-
.NETFramework 4.6.2
- System.ComponentModel.Annotations (>= 5.0.0)
- System.Management (>= 6.0.1)
- System.Net.Http (>= 4.3.4)
- System.Text.Json (>= 6.0.5)
-
.NETFramework 4.7
- System.ComponentModel.Annotations (>= 5.0.0)
- System.Management (>= 6.0.1)
- System.Net.Http (>= 4.3.4)
- System.Text.Json (>= 6.0.5)
-
.NETFramework 4.7.1
- System.ComponentModel.Annotations (>= 5.0.0)
- System.Management (>= 6.0.1)
- System.Net.Http (>= 4.3.4)
- System.Text.Json (>= 6.0.5)
-
.NETFramework 4.7.2
- System.ComponentModel.Annotations (>= 5.0.0)
- System.Management (>= 6.0.1)
- System.Net.Http (>= 4.3.4)
- System.Text.Json (>= 6.0.5)
-
.NETFramework 4.8
- System.ComponentModel.Annotations (>= 5.0.0)
- System.Management (>= 6.0.1)
- System.Net.Http (>= 4.3.4)
- System.Text.Json (>= 6.0.5)
-
.NETStandard 2.0
- System.ComponentModel.Annotations (>= 5.0.0)
- System.Management (>= 6.0.1)
- System.Net.Http (>= 4.3.4)
- System.Text.Json (>= 7.0.2)
-
.NETStandard 2.1
- System.ComponentModel.Annotations (>= 5.0.0)
- System.Management (>= 6.0.1)
- System.Net.Http (>= 4.3.4)
- System.Text.Json (>= 7.0.2)
-
net5.0
- System.ComponentModel.Annotations (>= 5.0.0)
- System.Management (>= 6.0.1)
-
net6.0
- System.ComponentModel.Annotations (>= 5.0.0)
- System.Management (>= 6.0.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.