How to limit the number of users logged in to a web application
PreviousHow to get the list of activated computersNextHow to deactivate a license if a user's computer is dead
Last updated
LicenseValidator lv = new LicenseValidator ();
bool needsActivation = false;
string errorMsg = string.Empty;
string computerID = Environment.MachineName;
if (lv.ValidateLicenseAtStartup(computerID, ref needsActivation, ref errorMsg) == false)
{
// Launch a form that prompts the user to enter the ActivationKey and activate it.
}
else
{
Console.WriteLine (lv.QlmLicenseObject.NumberOfLicenses.ToString());
}