How to validate if a license was revoked on the server?
public bool VerifyLicenseOnServer ()
{
bool ret = false;
string webServiceUrl = "https://qlm3.net/qlmdemo/qlmLicenseServer/qlmservice.asmx";
string response;
string qlmVersion = "6.0.00";
string storedActivationKey = string.Empty;
string storedComputerKey = string.Empty;
string computerID = System.Environment.MachineName;
string computerName = System.Environment.MachineName;
QLM.LicenseValidator lv = new QLM.LicenseValidator();
lv.QlmLicense.ReadKeys(ref storedActivationKey, ref storedComputerKey);
if (!String.IsNullOrEmpty(storedActivationKey))
{
if (lv.QlmLicense.IsLicenseKeyRevoked(webServiceUrl, storedActivationKey))
{
MessageBox.Show(String.Format ("License key {0} was revoked.", storedActivationKey));
}
else if (lv.QlmLicense.IsIllegalComputer(webServiceUrl, storedActivationKey, storedComputerKey, computerID, computerName, qlmVersion, out response))
{
ILicenseInfo li = new LicenseInfo();
string message = string.Empty;
lv.QlmLicense.ParseResults(response, ref li, ref message);
MessageBox.Show("Illegal Computer License: " + message);
}
else
{
ret = true;
}
}
return ret;
}Last updated