How to get information about a license key
To retrieve information about a specific license key from the License Server, call the GetLicenseInfo API. If the call is successful, the ILicenseInfo will be populated with the most common fields associated to the license. If the field you are interested in is not part of the ILicenseInfo structure, you can retrieve it by parsing the returned dataSet.
If the call fails, the return value will be null.
C# Example:
// Assuming lv is an instance of the LicenseValidator class:
string dataSet;
string response;
QlmLicenseLib.ILicenseInfo licenseInfo;
licenseInfo = lv.QlmLicenseObject.GetLicenseInfo(String.Empty, lv.ActivationKey, false, out dataSet, out response);
if (licenseInfo != null)
{
// access the licenseInfo structure
string computerKey = licenseInfo.ComputerKey;
// If you want access to all the fields, access the dataSet
DataSet ds = new DataSet("NewDataSet");
XmlReader reader = new XmlTextReader(dataSet, XmlNodeType.Document, null);
if (!String.IsNullOrEmpty(dataSet))
{
ds.ReadXml(reader);
if ((ds.Tables.Count > 0) && ds.Tables[0].Rows.Count > 0)
{
DataRow dr = ds.Tables[0].Rows[0];
string computerID = dr["ComputerID"].ToString();
int numLicenses = (int) dr["NumLicenses"];
int availableLicenses = (int)dr["AvailableLicenses"];
bool revoked = (bool)dr["Disabled"];
string enabledFeatures = dr["Features"].ToString();
int[] features = lv.QlmLicenseObject.ConvertFeaturesToArray(enabledFeatures);
}
}
}VB.NET Example:
VC++Example:
PreviousError 80131700, 8013101b, 80131515 when instantiating a QLM objectNextHow to create a product with STD and PRO editions as features
Last updated