←Select platform

SetLicense(string,string) Method

Summary
Sets the runtime license for LEADTOOLS and unlocks support for optional features such as LEADTOOLS Imaging Pro, Document, and Medical capabilities. After you have obtained a runtime license and a developer key, you can call Leadtools.RasterSupport.SetLicense in your application to disable the nag message.
Syntax
C#
Objective-C
C++/CLI
Java
Python
public static void SetLicense( 
   string licenseFile, 
   string developerKey 
) 
+ (BOOL)setLicenseFile:(NSString *)licenseFile 
          developerKey:(NSString *)developerKey 
                 error:(NSError **)error 
public static void setLicense( 
  String licenseFile,  
  String developerKey 
) 
public: 
static void SetLicense(  
   String^ licenseFile, 
   String^ developerKey 
)  
def SetLicense(self,licenseFile,developerKey): 

Parameters

licenseFile
Character string containing the name of the LEADTOOLS runtime license file to load.

developerKey
Character string containing the developer key.

Remarks

You must use this method to set the runtime license for LEADTOOLS and to unlock support for any optional features that you have licensed. If you do not set a RELEASE runtime license, your application will display a nag message dialog at runtime, indicating that you have developed the application without a valid runtime license.

In order to obtain a runtime license and developer key, you must contact LEAD. For more information, refer to About LEADTOOLS Runtime Licenses.

For information about LEADTOOLS Document/Medical capabilities, contact LEAD.

To determine if support for optional features has been unlocked, use IsLocked.

NOTE: As an alternative to calling RasterSupport.SetLicense, you can specify your runtime license in the Leadtools.dll.config file. For more information, see LEADTOOLS Config License.

To set the runtime license from a memory buffer instead of disk file, use SetLicense(byte[] licenseBuffer, string developerKey).

Example
C#
using Leadtools; 
 
 
public void SetLicenseFileExample() 
{ 
#if DEBUG 
	LicenseSupport.SetLicense(); 
#else 
	string MY_LICENSE_FILE = @"leadtools.lic"; 
	string MY_DEVELOPER_KEY = "xyz123abc"; 
	RasterSupport.SetLicense(MY_LICENSE_FILE, MY_DEVELOPER_KEY); 
#endif 
	bool isLocked = RasterSupport.IsLocked(RasterSupportType.Document); 
	if (isLocked) 
		Console.WriteLine("Document support is locked"); 
	else 
		Console.WriteLine("Document support is unlocked"); 
} 
Requirements

Target Platforms

Help Version 22.0.2023.5.16
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.

Leadtools Assembly
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.