Sky Software Homepage LogicNP Software Knowledge Base And FAQ

 
Contact Product Support    SearchSearch      Subscribe to the RSS feed for this forum

HOWTO: Create a license requiring activation with a grace period.

 
Subscribe to the RSS feed for this forum  Forum Index -> CryptoLicensing For .Net
View previous topic :: View next topic  
Author Message
Support



Joined: 18 Jul 2005
Posts: 731

Posted: Wed Apr 28, 2010 5:26 am    Post subject: HOWTO: Create a license requiring activation with a grace period.

In CryptoLicensing, a license code can have any combination of settings/limits. So to generate a license requiring activation with a grace period, in CryptoLicensing Generator UI, check 'Activations: Limit Machines To' and the 'Max Usage Days' check box. Specify the desired numbers for both these settings. Then click 'Generate'. The generated license will have both the Activation and the Max Usage Days limit so when it is validated, both limits will be checked.

If the user cannot activate the license (maybe due to lack of an internet connection), the CryptoLicense.Status property will return LicenseStatus.ActivationFailed. After the grace period is over (as specify by the 'Max Usage Days' setting), the CryptoLicense.Status property will return (LicenseStatus.ActivationFailed | LicenseStatus.UsageDaysExceeded). This combination of statuses indicates that the user has not activated and the grace period is over.

Note

1. Instead of the 'Max Usage Days' setting, you can specify the 'Absolute Date of Expiration' or the 'Max Unique Usage Days' or any other setting.

2. When the license is activated, the license server returns a hardware-locked license with the same settings. You would typically wish the hardware-locked license to not have the 'Max Usage Days' setting. In that case, override the LicenseService.OnActivate method and use following code:
C#
Code:
protected override string OnActivate(CryptoLicense license, string machineCodeString)
{
  this.Generator.MaxUsageDays = short.MaxValue;
  return base.OnActivate(license,machineCodeString);
}


VB.Net
Code:
Protected Overridable Function OnActivate(ByVal license As CryptoLicense, ByVal machineCodeString As String) As String
  Me.Generator.MaxUsageDays = Int16.MaxValue
  Return MyBase.OnActivate(license,machineCodeString)
End Function
Back to top
Display posts from previous:   
Forum Index -> CryptoLicensing For .Net All times are GMT
Page 1 of 1

 
Jump to:  


Powered by phpBB © 2001, 2005 phpBB Group