ExisOne.Client
0.4.0
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package ExisOne.Client --version 0.4.0
NuGet\Install-Package ExisOne.Client -Version 0.4.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="ExisOne.Client" Version="0.4.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="ExisOne.Client" Version="0.4.0" />
<PackageReference Include="ExisOne.Client" />
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add ExisOne.Client --version 0.4.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: ExisOne.Client, 0.4.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.
#:package ExisOne.Client@0.4.0
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=ExisOne.Client&version=0.4.0
#tool nuget:?package=ExisOne.Client&version=0.4.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Software Activation System
A comprehensive software licensing and activation system built with .NET 8, Entity Framework Core, and SQL Server.
Features
- Product management with versioning
- License generation and activation
- Hardware-locked licensing
- License validation and expiration
- License deactivation
- License history tracking
- Admin dashboard for license management
Project Structure
SoftwareActivationSystem.Api: ASP.NET Core Web API project containing the license management systemSoftwareActivationSystem.Core: Core library containing shared interfaces and modelsSoftwareActivationSystem.HardwareId: Library for generating unique hardware IDs
Setup
- Update the database connection string in
appsettings.jsonwith your Azure SQL Database credentials:
{
"ConnectionStrings": {
"DefaultConnection": "Server=exiswwwdb.database.windows.net;Database=exiswwwdb;User Id=your_username;Password=your_password;"
}
}
- Build and run the solution:
dotnet build
dotnet run --project SoftwareActivationSystem.Api
- Access the web interface at
https://localhost:5001to generate activation keys.
API Endpoints
Products
GET /api/products- Get all productsGET /api/products/{id}- Get a specific productPOST /api/products- Create a new productPUT /api/products/{id}- Update a productDELETE /api/products/{id}- Delete a product
Activation Keys
POST /api/activationkey/generate- Generate a new activation key{ "productName": "string", "email": "string", "validityDays": number }
Licenses
GET /api/license- Get all licensesPOST /api/license/activate- Activate a license{ "activationKey": "string", "email": "string", "hardwareId": "string", "productName": "string" }POST /api/license/validate- Validate a license{ "activationKey": "string", "hardwareId": "string" }POST /api/license/check- Check if a license is valid{ "activationKey": "string", "hardwareId": "string" }POST /api/license/deactivate- Deactivate a license{ "licenseKey": "string", "productName": "string", "hardwareId": "string" }PUT /api/license/{activationKey}/expiration- Update license expiration date{ "expirationDate": "2023-12-31T23:59:59Z" }GET /api/license/{activationKey}/history- Get license history
Integration Guide
1. Hardware ID Generation
public static string GetHardwareId()
{
var cpuId = GetCpuId();
var motherboardId = GetMotherboardId();
var diskId = GetDiskId();
// Combine and hash the hardware IDs
var combinedId = $"{cpuId}|{motherboardId}|{diskId}";
using (var sha256 = SHA256.Create())
{
var hash = sha256.ComputeHash(Encoding.UTF8.GetBytes(combinedId));
return BitConverter.ToString(hash).Replace("-", "").Substring(0, 32);
}
}
private static string GetCpuId()
{
try
{
var mbs = new ManagementObjectSearcher("Select ProcessorId From Win32_processor");
var mbsList = mbs.Get();
foreach (var mo in mbsList)
{
return mo["ProcessorId"].ToString();
}
}
catch { }
return string.Empty;
}
private static string GetMotherboardId()
{
try
{
var mbs = new ManagementObjectSearcher("Select SerialNumber From Win32_BaseBoard");
var mbsList = mbs.Get();
foreach (var mo in mbsList)
{
return mo["SerialNumber"].ToString();
}
}
catch { }
return string.Empty;
}
private static string GetDiskId()
{
try
{
var mbs = new ManagementObjectSearcher("Select SerialNumber From Win32_DiskDrive");
var mbsList = mbs.Get();
foreach (var mo in mbsList)
{
return mo["SerialNumber"].ToString();
}
}
catch { }
return string.Empty;
}
2. License Activation
public async Task<License> ActivateLicenseAsync(string activationKey, string email)
{
var hardwareId = GetHardwareId();
using (var client = new HttpClient())
{
client.BaseAddress = new Uri("https://xmis.azurewebsites.net/");
var request = new
{
ActivationKey = activationKey,
Email = email,
HardwareId = hardwareId,
ProductName = "YourProductName" // Replace with your product name
};
var response = await client.PostAsJsonAsync("api/license/activate", request);
if (response.IsSuccessStatusCode)
{
return await response.Content.ReadFromJsonAsync<License>();
}
var error = await response.Content.ReadAsStringAsync();
throw new Exception($"Activation failed: {error}");
}
}
3. License Validation
public async Task<bool> ValidateLicenseAsync(string activationKey)
{
var hardwareId = GetHardwareId();
using (var client = new HttpClient())
{
client.BaseAddress = new Uri("https://xmis.azurewebsites.net/");
var request = new
{
ActivationKey = activationKey,
HardwareId = hardwareId
};
var response = await client.PostAsJsonAsync("api/license/validate", request);
if (response.IsSuccessStatusCode)
{
var result = await response.Content.ReadFromJsonAsync<ValidationResult>();
return result.IsValid;
}
return false;
}
}
4. License Deactivation
public async Task<bool> DeactivateLicenseAsync(string licenseKey, string productName, string hardwareId)
{
using (var client = new HttpClient())
{
client.BaseAddress = new Uri("https://xmis.azurewebsites.net/");
var request = new
{
LicenseKey = licenseKey,
ProductName = productName,
HardwareId = hardwareId
};
var response = await client.PostAsJsonAsync("api/license/deactivate", request);
if (response.IsSuccessStatusCode)
{
return true;
}
var error = await response.Content.ReadAsStringAsync();
throw new Exception($"Deactivation failed: {error}");
}
}
License Service Implementation
public class LicenseService
{
private readonly HttpClient _httpClient;
private readonly string _baseUrl = "https://xmis.azurewebsites.net/";
public LicenseService()
{
_httpClient = new HttpClient
{
BaseAddress = new Uri(_baseUrl)
};
}
public async Task<License> ActivateLicenseAsync(string activationKey, string email)
{
var hardwareId = GetHardwareId();
var request = new
{
ActivationKey = activationKey,
Email = email,
HardwareId = hardwareId,
ProductName = "YourProductName" // Replace with your product name
};
var response = await _httpClient.PostAsJsonAsync("api/license/activate", request);
if (response.IsSuccessStatusCode)
{
return await response.Content.ReadFromJsonAsync<License>();
}
var error = await response.Content.ReadAsStringAsync();
throw new Exception($"Activation failed: {error}");
}
public async Task<bool> ValidateLicenseAsync(string activationKey)
{
var hardwareId = GetHardwareId();
var request = new
{
ActivationKey = activationKey,
HardwareId = hardwareId
};
var response = await _httpClient.PostAsJsonAsync("api/license/validate", request);
if (response.IsSuccessStatusCode)
{
var result = await response.Content.ReadFromJsonAsync<ValidationResult>();
return result.IsValid;
}
return false;
}
public async Task<bool> DeactivateLicenseAsync(string licenseKey)
{
var request = new
{
LicenseKey = licenseKey,
ProductName = "YourProductName" // Replace with your product name
};
var response = await _httpClient.PostAsJsonAsync("api/license/deactivate", request);
if (response.IsSuccessStatusCode)
{
return true;
}
var error = await response.Content.ReadAsStringAsync();
throw new Exception($"Deactivation failed: {error}");
}
private static string GetHardwareId()
{
// Implementation as shown above
}
}
License Models
public class License
{
public string ActivationKey { get; set; }
public string Email { get; set; }
public string HardwareId { get; set; }
public DateTime? ActivationDate { get; set; }
public DateTime ExpirationDate { get; set; }
public bool IsActive { get; set; }
public string ProductName { get; set; }
public string Version { get; set; }
}
public class ValidationResult
{
public bool IsValid { get; set; }
}
License History
public class LicenseHistory
{
public int Id { get; set; }
public string ActivationKey { get; set; }
public string Email { get; set; }
public string HardwareId { get; set; }
public string? IpAddress { get; set; }
public string? Country { get; set; }
public DateTime ActivationDate { get; set; }
public DateTime? DeactivationDate { get; set; }
public string Action { get; set; }
public string Notes { get; set; }
public DateTime CreatedAt { get; set; }
}
.NET Client SDK (NuGet)
Package: ExisOne.Client (version 0.3.0)
Install:
dotnet add package ExisOne.Client --version 0.3.0
Usage:
var options = new ExisOneClientOptions { BaseUrl = "https://your-api/" };
var client = new ExisOneClient(options);
// Generate hardware ID
var hardwareId = client.GenerateHardwareId();
// Activate
await client.ActivateAsync(activationKey, email, hardwareId, productName);
// Validate
var isValid = await client.ValidateAsync(activationKey, hardwareId);
// Deactivate (requires same hardwareId)
var ok = await client.DeactivateAsync(activationKey, hardwareId, productName);
Getting Started
- Clone the repository
- Update the connection string in
appsettings.json - Run the migrations:
dotnet ef database update - Run the application:
dotnet run
Admin Dashboard
Access the admin dashboard at /admin to manage products, licenses, and activation keys.
License
This project is licensed under the MIT License - see the LICENSE file for details.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. 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. net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net8.0
- No dependencies.
-
net9.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.