LicenseHelperApplicationLicenseKey Property |
Namespace: Ab2d.Licensing.ReaderSvg
Usually licensing of AB4D libraries is done with using the standard .Net components licensing mechanism.
This mechanism works with adding a license.licx file to the project and set its content to the specified type that contain the licensing code. When the .Net compiler gets the license.licx file, it calls the licensing code. That code gets the installed license key from registry and saves a special runtime license key into the compiled assembly. This means that at runtime, the licensed library can read the runtime license key from the assembly and can allow application to use the licensed library.
The ApplicationLicenseKey property provides an alternative option to use licensed library on other computers.
Instead of using license.licx file it is possible to set the ApplicationLicenseKey to the special license key. This special license key is checked by licensing code and if valid it allows using the licensed library.
The value of ApplicationLicenseKey cannot be set to the license key that is get from User Accont page. Instead a special license key is needed. This license key includes the name of the target application and can be used only for the application for which it was created for. This means that even if the license key would be obtained from the application with decompilation, it cannot be used on another application.
To get the special license key please write a request to support@ab4d.com and pride the name of the application that will use the ApplicationLicenseKey. The name of the application can be get with running the following code while the application is running:
string applicationName = System.Reflection.Assembly.GetEntryAssembly().GetName().Name;
IMPORTANT:
The ApplicationLicenseKey must be set before the constructor of the ReaderSvg is called!
It is recommended that the EmbeddedLicenseAssembly is set in the constructor of the class that is using ReaderSvg and before call to InitializeComponent method.
The following code shows how to set the assembly in the constructor of the class that is using ReaderSvg.
public class MyClass() { public MyClass() { Ab2d.Licensing.ReaderSvg.LicenseHelper.ApplicationLicenseKey = "1234-5678-..."; InitializeComponent(); } }