With the .NET library "License.dll" you are able to determine
the current license status of your locked software at runtime. You
only need to reference this library in your project and access the
corresponding methods and properties. All methods and properties
should be self explanatory. You don't need to select a license
file. If a valid license file is available it will be used
automatically to update the license status.
Please note, the methods and properties of "License.dll" only
returns the correct values after you have protect your software.
After protection the library "License.dll" is not needed
anymore.
How To Example Code:
Reference Namespace of
License.dll
using License;
Check if a valid license file
is available
/*** Check if a valid license file is available. ***/
public bool IsValidLicenseAvailable()
{
return License.Status.Licensed;
}
Read additonal license
information from a license license
/*** Read additonal license information from a license license ***/
public void ReadAdditonalLicenseInformation()
{
/* Check first if a valid license file is found */
if (License.Status.Licensed)
{
/* Read additional license information */
for (int i = 0; i < License.Status.KeyValueList.Count; i++)
{
string key = License.Status.KeyValueList.GetKey(i).ToString();
string value = License.Status.KeyValueList.GetByIndex(i).ToString();
}
}
}
Check the license status of
Evaluation Lock
/*** Check the license status of Evaluation Lock ***/
public void CheckEvaluationLock()
{
bool lock_enabled = License.Status.Evaluation_Lock_Enabled;
EvaluationType ev_type = License.Status.Evaluation_Type;
int time = License.Status.Evaluation_Time;
int time_current = License.Status.Evaluation_Time_Current;
}
Check the license status of
Expiration Date Lock
/*** Check the license status of Expiration Date Lock ***/
public void CheckExpirationDateLock()
{
bool lock_enabled = License.Status.Expiration_Date_Lock_Enable;
System.DateTime expiration_date = License.Status.Expiration_Date;
}
Check the license status of
Number Of Uses Lock
/*** Check the license status of Number Of Uses Lock ***/
public void CheckNumberOfUsesLock()
{
bool lock_enabled = License.Status.Number_Of_Uses_Lock_Enable;
int max_uses = License.Status.Number_Of_Uses;
int current_uses = License.Status.Number_Of_Uses_Current;
}
Check the license status of
Number Of Instances Lock
/*** Check the license status of Number Of Instances Lock ***/
public void CheckNumberOfInstancesLock()
{
bool lock_enabled = License.Status.Number_Of_Instances_Lock_Enable;
int max_instances = License.Status.Number_Of_Instances;
}
Check the license status of
Hardware Lock
/*** Check the license status of Hardware Lock ***/
public void CheckHardwareLock()
{
bool lock_enabled = License.Status.Hardware_Lock_Enabled;
if (lock_enabled)
{
/* Get Hardware ID which is stored inside the license file */
string lic_hardware_id = License.Status.License_HardwareID;
}
}
Get Hardware ID of the current
machine
/*** Get Hardware ID of the current machine ***/
public string GetHardwareID()
{
return License.Status.HardwareID;
}
Compare current Hardware ID
with Hardware ID stored in License File
/*** Compare current Hardware ID with Hardware ID stored in License File ***/
public bool CompareHardwareID()
{
if (License.Status.HardwareID == License.Status.License_HardwareID)
return true;
else
return false;
}
/*** Invalidate the license. Please note, your protected software does not accept a license file anymore! ***/
public void InvalidateLicense()
{
string confirmation_code = License.Status.InvalidateLicense();
}
Check if a confirmation code
is valid
/*** Check if a confirmation code is valid ***/
public bool CheckConfirmationCode(string confirmation_code)
{
return License.Status.CheckConfirmationCode(License.Status.HardwareID,
confirmation_code);
}
/*** Reactivate an invalidated license. ***/
public bool ReactivateLicense(string reactivation_code)
{
return License.Status.ReactivateLicense(reactivation_code);
}
Manually load a license using
a filename
/*** Load the license. ***/
public void LoadLicense(string filename)
{
License.Status.LoadLicense(filename);
}
Manually load a license using
byte[]
/*** Load the license. ***/
public void LoadLicense(byte[] license)
{
License.Status.LoadLicense(license);
}
Get loaded license (if
available) as byte[]
/*** Get the license. ***/
public byte[] GetLicense()
{
return License.Status.License;
}
|