How to validate if a license was revoked on the server?

As of version QLM12, please follow the instructions in this article.

To verify if a license was revoked on the server or if a license is illegal, add the code below to your application. If you are using the LicenseValidator class generated by the Protect Your Application wizard, simply set the checkIfLicenseIsRevoked property to true.

You can find the definition of an "Illegal Computer" in the QLM online help.

To revoke a license, locate the license in the Manage Keys tab, click on the Edit button and check the "Disabled" checkbox.

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