How to get license information through FineReader Engine API?

Question

How to get license information through FineReader Engine API?

Answer

You can use the following code (C#) to list the available licenses based on the projectID value, which should be passed to the GetAvailableLicenses() method.

ILicenses licenses = Engine.GetAvailableLicenses("projectID");

After that, you can iterate through this object in the following way:

for (int i = 0; i < licenses.Count; i++)
{
Console.WriteLine("Serial number of the {0} license is {1}", i, licenses[i].SerialNumber);
Console.WriteLine("Total volume in pages of the {0} license is {1}", licenses[i].SerialNumber, licenses[i].Volume[FREngine.LicenseCounterTypeEnum.LCT_Pages]); Console.WriteLine("Remaining volume in pages of the {0} license is {1}", licenses[i].SerialNumber, licenses[i].VolumeRemaining[FREngine.LicenseCounterTypeEnum.LCT_Pages]); licenses[i].ExpirationDate(out int Year, out int Month, out int Day); if (Year == 0 && Month == 0 && Day == 0) Console.WriteLine("{0} license has no time limitation", licenses[i].SerialNumber); Console.WriteLine("Expiration date of the {0} license is: Year: {1} Month: {2} Day: {3}", licenses[i].SerialNumber, Year, Month, Day); }

Have more questions? Submit a request

Comments

0 comments

Please sign in to leave a comment.