Page 1 of 1
License Key
Posted: Tue Aug 01, 2023 3:10 pm
by jasonvv
I am interested in retrieving the SoftPro serial number from the SerialNumber property. The interface ILicenseKey has the SerialNumber property but I am unsure how to call it. The GetService method does not appear to support ILicenseKey. This might be more of a C# question than an API question but hoping for a hint. Thanks!
Re: License Key
Posted: Tue Aug 01, 2023 5:12 pm
by BobRichards
The
ILicensing service may only available on the server service provider - I don't remember.
However the code below will get the serial number for the first license it finds. All the licenses should have the same number.
Code: Select all
public GetLicenseKeys(SelectServer ss)
{
var licMgr = ss.GetService<ILicensing>();
string serialNumber = licMgr.Keys.FirstOrDefault().SerialNumber;
}
Re: License Key
Posted: Tue Aug 01, 2023 8:11 pm
by jasonvv
That worked! Thank you very much.