cancel
Showing results for 
Search instead for 
Did you mean: 

Getting a List of Registered Products when Using the Flexnet Connect .NET XT SDK

Getting a List of Registered Products when Using the Flexnet Connect .NET XT SDK

Summary

Getting a List of Registered Products when Using the Flexnet Connect .NET XT SDK.

Synopsis

Earlier versions of the FNC Windows Agent provided an EnumProducts() API to query those products which were registered with Flexnet Connect. This API is no longer available in the .NET XT SDK.. This article provides sample code which can be used to get a list of registered products.

Discussion

When using the XT SDK's, all registered products are stored in a single file named productConfig.xml... In older agents, each product had a separate registration file... In order to determine a list of registered products, it will be necessary to parse the productConfig.xml file to get a list of product codes.. The following code blurb shows how this might be done:

private static IProduct product;
private static IConnect connectClient;
private static string myProduct = "{78AAAEA6-CB8D-4F0E-9E6B-3C378CD921A6}"; //Enter a registered product code

product = connectClient.GetProduct(myProduct);
XmlDocument doc = new XmlDocument();
doc.Load(connectClient.StoragePath + "\\productconfig.xml");
XmlNodeList elemList = doc.GetElementsByTagName("Collection");
for (int i = 0; i < elemList.Count; i++)
{
string attrVal = elemList.Attributes["id"].Value;
Console.WriteLine(attrVal);
}
Labels (2)
Was this article helpful? Yes No
No ratings