Infralution
Joined: 28 Feb 2005 Posts: 5027
|
Posted: Sun Jan 15, 2006 9:39 pm Post subject: Can I extend/reset the trial period for a customer? |
|
|
Probably the easiest way to handle this is to provide a separate small utility to customers that you wish to provide an extension to, that allows a one time reset of their evaluation period. The program below shows how to do this:
Code: | using System;
using System.Collections.Generic;
using System.Windows.Forms;
using Infralution.Licensing;
namespace ResetEvaluation
{
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
EvaluationMonitor resetMonitor = new RegistryEvaluationMonitor("MyResetPassword");
try
{
if (resetMonitor.UsageCount <= 1)
{
EvaluationMonitor appMonitor = new RegistryEvaluationMonitor("MyEvaluationPassword");
appMonitor.Reset(false);
MessageBox.Show("The evaluation period has been reset", "Reset Evaluation");
}
else
{
MessageBox.Show("The evaluation period has already been reset", "Reset Evaluation",
MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
}
}
catch (Exception)
{
MessageBox.Show("An error occurred while resetting the evaluation", "Reset Evaluation");
}
}
}
} |
The resetMonitor prevents the customer running this program more than once. You should change "MyResetPassword" to a new password unique to you and change "MyEvaluationPassword" to match the evaluation product id you use in your application.
An alternative approach if you are using Authenticated Licensing (Version 5.8 or later) is to issue a time limited License Key. You can create an Evaluation in License Tracker and then issue a license key and set the Expiry Date _________________ Infralution Support |
|