How to get the list of activated computers
private void GetActivatedLicenses (string activationKey)
{
bool needsActivation = false;
string errorMsg = string.Empty;
string table;
string dataSet = string.Empty;
string response = string.Empty;
activationKey = activationKey.Replace("-", "");
string filter = String.Format("ActivationKey='{0}'", activationKey);
LicenseValidator lv = new LicenseValidator();
lv.QlmLicenseObject.AdminEncryptionKey = "{B6163D99-F46A-4580-BB42-BF276A507A14}"; // replace this as needed
bool ret = lv.ValidateLicense(activationKey, string.Empty, string.Empty, ref needsActivation, ref errorMsg);
if (ret || needsActivation)
{
if (lv.QlmLicenseObject.NumberOfLicenses == 1)
{
table = "qryLicenseInfo";
}
else
{
table = "qryActivationLog";
}
lv.QlmLicenseObject.GetDataSetEx(string.Empty, table, filter, ref dataSet, out response);
DataSet ds = new DataSet("NewDataSet");
XmlReader reader = new XmlTextReader(dataSet, XmlNodeType.Document, null);
if (!String.IsNullOrEmpty(dataSet))
{
ds.ReadXml(reader);
if (ds.Tables[0].Rows.Count > 0)
{
DataRowCollection drc = ds.Tables[0].Rows;
if (drc != null)
{
foreach (DataRow dr in drc)
{
string computerKey = dr["computerKey"].ToString();
string computerID = dr["computerID"].ToString();
}
}
}
}
}
}PreviousTool to delete registered license keys on a systemNextHow to limit the number of users logged in to a web application
Last updated