.NET & DevOps Engineer | Cloud Specialist | Team Enabler
My name is Miha and I've been tinkering with computers for some time now. I remember getting Pentium 100 in the late '90s and that's how it all started.
Specialities:
by Miha J.
.NET Reactor is a code protection and licensing system for .NET applications. It has SDK, that supports maintaining licenses within your devops toolkits.
I will not cover the license generation part in this post, but you can check the documentation for more details.
Normally .NET Reactor produces *.license
files that can be put in the same folder as your protected application. If you want to examine the license, you can use the GUI, but I will focus on C# SDK approach.
To read a license file, you need to:
Eziriz.Reactor.LicenseGenerator
to your project.ProjectFile
with MasterKey
ready. If your MasterKey
is not part of the project file, you need to load it separately. MasterKey is needed to decrypt the license file.public void ViewLicenseInformation(string projectFile, string licenseFile)
{
//load project file with LicenseGenerator
var licenseReader = new LicenseGenerator(projectFile);
//load license file you want to inspect
licenseReader.LoadLicenseFromFile(licenseFile);
//Read license property, here is a simple example
Console.WriteLine($"ExpiryDate: {licenseReader.ExpirationDate}");
Console.WriteLine("Reading Additional Values:");
foreach (DictionaryEntry value in licenseReader.KeyValueTable)
{
Console.WriteLine($"{value.Key}: {value.Value}");
}
}
This will print out ExpiryDate and two additional custom values:
ExpiryDate: 31/12/2024 00:00:00
Company: My Company
Property1: 100000000
I hope this helps :).
tags: dotnet, - .net - reactor