You want to ship a trial version of your app. Here's the easiest way: embed a trial key directly in the code.
No server. No activation. Just works.
Why Embedded Trial Keys?
Traditional trial approach:
- User downloads app
- User registers on your website
- You email a trial key
- User enters key in app
- App validates online
Result: 30-40% of users drop off before trying your app.
Embedded trial approach:
- User downloads app
- App runs immediately (trial key embedded)
- User evaluates
Result: 100% trial start rate.
Step 1: Create a Trial Key
In QLM Management Console:
1. Manage Keys → Create
2. Product: [Your Product]
3. License Model: Trial
4. Expiry Date: 30 days from today
5. Number of Licenses: 1
6. Click OK
Copy the generated key (example: A5B3C-D8E2F-G1H4I-J7K9L-M3N6P).
Step 2: Embed the Key
using System;
using QLM.LicenseLib;
class Program
{
// Embedded trial key - same for all users
private const string TRIAL_KEY = "A5B3C-D8E2F-G1H4I-J7K9L-M3N6P";
static void Main(string[] args)
{
if (ValidateLicense())
{
Console.WriteLine("Trial active - running app");
RunApp();
}
else
{
Console.WriteLine("Trial expired or invalid");
}
}
static bool ValidateLicense()
{
var lv = new LicenseValidator("settings.xml");
bool needsActivation = false;
string errorMsg = string.Empty;
// First check if license exists locally
bool isValid = lv.ValidateLicenseAtStartup(
ELicenseBinding.ComputerName,
ref needsActivation,
ref errorMsg
);
// If no license found, use embedded trial key
if (!isValid && string.IsNullOrEmpty(lv.ActivationKey))
{
lv.ActivationKey = TRIAL_KEY;
lv.ComputerKey = string.Empty;
isValid = lv.ValidateLicenseAtStartup(
ELicenseBinding.ComputerName,
ref needsActivation,
ref errorMsg
);
if (isValid)
{
// Store trial key locally for next run
lv.QlmLicenseObject.StoreKeys(lv.ActivationKey, lv.ComputerKey);
Console.WriteLine("Trial started - 30 days remaining");
}
}
return isValid;
}
static void RunApp()
{
// Your application code here
}
}
How It Works
- First run: App checks for local license → none found
- App uses embedded key: Validates it against expiry date
- Trial starts: Key stored locally, expiry date locked
- Subsequent runs: App uses stored license
- After 30 days: License expires, app stops working
Important: The trial period starts on first use, not when you create the key. The expiry date is calculated from first validation.
Upgrade Path
When the user purchases, they get a permanent key:
// User enters purchased key via QLM License Wizard
// Wizard replaces trial key with permanent key
// App validates and works indefinitely
Show Days Remaining
static void ShowTrialStatus(LicenseValidator lv)
{
if (lv.QlmLicenseObject.LicenseModel == ELicenseModel.trial)
{
DateTime expiryDate = lv.QlmLicenseObject.ExpiryDate;
int daysLeft = (expiryDate - DateTime.Now).Days;
if (daysLeft > 0)
{
Console.WriteLine($"Trial: {daysLeft} days remaining");
}
else
{
Console.WriteLine("Trial expired");
}
}
}
Alternative: Different Key Per User
If you want to track each download:
// Generate trial key server-side when user downloads
// Embed unique key per user
// Track which keys are activated
But this requires a server call. The embedded approach is simpler.
Pros & Cons
Pros:
- ✅ Zero friction — app runs immediately
- ✅ No server required for trial
- ✅ Works offline
- ✅ Same binary for trial & paid
Cons:
- ❌ Can't track who tries your app
- ❌ Key can be extracted (not a real issue for trials)
- ❌ One key for all users (acceptable for trials)
When to Use This
Use embedded keys when:
- Frictionless trial is priority #1
- You don't need to track trial users
- You want offline trial support
Don't use when:
- You need to track every download
- You want unique keys per user
- You need trial usage analytics
Supported Platforms
- Windows: .NET Framework 2.x / 4.x, .NET 6/7/8/9/10
- Cross-platform: .NET 6/7/8/9/10 (macOS, Linux)
- Mobile: Android, iOS (.NET MAUI, Xamarin)
Quick License Manager
This uses Quick License Manager (QLM).
Pricing (per developer):
- QLM Express: $200/year
- QLM Professional: $699/year
- QLM Enterprise: $999/year
Resources
- Quick License Manager
- Features
- Pricing
- Tutorials
- Documentation
- How to ship an evaluation version
- How to generate trial keys
Related articles:
How do you handle trials in your apps? Share in the comments! 👇
Quick License Manager by Soraco Technologies — https://soraco.co
Top comments (0)