SetLicense

SetLicense(Stream)

Licenses the component.

public void SetLicense(Stream licenseStream)
Parameter Type Description
licenseStream Stream The license stream.

Exceptions

exception condition
ArgumentNullException Thrown when licenseStream is null.

Examples

The following example demonstrates how to set a license passing Stream of the license file.

using (FileStream licenseStream = File.OpenRead("GroupDocs.Viewer.lic"))
{
    License license = new License();
    license.SetLicense(licenseStream);
}

See Also


SetLicense(string)

Licenses the component.

public void SetLicense(string licensePath)
Parameter Type Description
licensePath String The license file path.

Exceptions

exception condition
ArgumentException Thrown when licensePath is null or empty string.

Examples

The following example demonstrates how to set a license passing a path to the license file.

string licensePath = "GroupDocs.Viewer.lic";
License license = new License();
license.SetLicense(licensePath);

See Also