LicenseSetLicense Method (String)
Licenses the component.

Namespace: GroupDocs.Viewer
Assembly: GroupDocs.Viewer (in GroupDocs.Viewer.dll) Version: 19.9
Syntax
public void SetLicense(
	string licensePath
)

Parameters

licensePath
Type: SystemString
The license file path.
Exceptions
ExceptionCondition
ArgumentExceptionlicensePath is a zero-length string, contains only white space, or contains one or more invalid characters as defined by InvalidPathChars.
ArgumentNullExceptionlicensePath is null.
PathTooLongExceptionThe specified path, file name, or both exceed the system-defined maximum length. For example, on Windows-based platforms, paths must be less than 248 characters, and file names must be less than 260 characters.
DirectoryNotFoundExceptionThe specified path is invalid, (for example, it is on an unmapped drive).
UnauthorizedAccessExceptionlicensePath specified a directory.-or- The caller does not have the required permission.
FileNotFoundExceptionThe file specified in licensePath was not found.
NotSupportedExceptionlicensePath is in an invalid format.
Examples
The following example demonstrates how to set a license passing a path to the license file.
C#
string licensePath = "GroupDocs.Viewer.lic";
GroupDocs.Viewer.License license = new GroupDocs.Viewer.License();
lic.SetLicense(licensePath);
See Also