Aspose::Email::License Class Reference

Provides methods to license the component. More...

Inherits Object.

Public Member Functions

bool get_IsLicensed ()
 
 License ()
 Initializes a new instance of this class. More...
 
void SetLicense (System::String licenseName)
 Licenses the component. More...
 
void SetLicense (System::SharedPtr< System::IO::Stream > stream)
 Licenses the component. More...
 
void SetLicense (System::SharedPtr< System::IO::FileInfo > licenseFile)
 Licenses the component. More...
 

Detailed Description

Provides methods to license the component.

In this example, an attempt will be made to find a license file named MyLicense.lic in the folder that contains

<ms> the component, in the folder that contains the calling assembly, in the folder of the entry assembly and then in the embedded resources of the calling assembly.

[C#]
License license = new License();
license.SetLicense("MyLicense.lic");
[Visual Basic]
Dim license As license = New license
License.SetLicense("MyLicense.lic")

</ms>

<java> the component jar file:

License license = new License();
license.setLicense("MyLicense.lic");

</java>

Constructor & Destructor Documentation

◆ License()

Aspose::Email::License::License ( )

Initializes a new instance of this class.

In this example, an attempt will be made to find a license file named MyLicense.lic in the folder that contains

<ms> the component, in the folder that contains the calling assembly, in the folder of the entry assembly and then in the embedded resources of the calling assembly.

[C#]
License license = new License();
license.SetLicense("MyLicense.lic");
[Visual Basic]
Dim license As license = New license
License.SetLicense("MyLicense.lic")

</ms>

<java> the component jar file:

License license = new License();
license.setLicense("MyLicense.lic");

</java>

Member Function Documentation

◆ get_IsLicensed()

bool Aspose::Email::License::get_IsLicensed ( )

◆ SetLicense() [1/3]

void Aspose::Email::License::SetLicense ( System::SharedPtr< System::IO::FileInfo >  licenseFile)

Licenses the component.

Parameters
licenseFileFile of licenseSystem::IO::FileInfo.
Exceptions
ArgumentNullExceptionlicenseFile is null.
System::IO::FileNotFoundExceptionThe file is not found.
System::UnauthorizedAccessExceptionThe file is read-only or is a directory.
System::IO::DirectoryNotFoundExceptionThe specified path is invalid, such as being on an unmapped drive.
System::IO::IOExceptionThe file is already open.

◆ SetLicense() [2/3]

void Aspose::Email::License::SetLicense ( System::SharedPtr< System::IO::Stream >  stream)

Licenses the component.

Parameters
streamA stream that contains the license.

Use this method to load a license from a stream.

<ms>
[C#]
License license = new License();
license.SetLicense(myStream);
[Visual Basic]
Dim license as License = new License
license.SetLicense(myStream)
</ms>
<java>
License license = new License();
license.setLicense(myStream);
</java>

<javaName>void setLicense(java.io.InputStream stream)</javaName>

◆ SetLicense() [3/3]

void Aspose::Email::License::SetLicense ( System::String  licenseName)

Licenses the component.

Tries to find the license in the following locations:

1. Explicit path.

<ms>

2. The folder of the component assembly.

3. The folder of the client's calling assembly.

4. The folder of the entry assembly.

5. An embedded resource in the client's calling assembly.

Note:On the .NET Compact Framework, tries to find the license only in these locations:

1. Explicit path.

2. An embedded resource in the client's calling assembly.

</ms>

<java>

2. The folder of the component jar file.

</java>

In this example, an attempt will be made to find a license file named MyLicense.lic in the folder that contains

<ms> the component, in the folder that contains the calling assembly, in the folder of the entry assembly and then in the embedded resources of the calling assembly.

[C#]
License license = new License();
license.SetLicense("MyLicense.lic");
[Visual Basic]
Dim license As License = New License
license.SetLicense("MyLicense.lic")

</ms>

<java> the component jar file:

License license = new License();
license.setLicense("MyLicense.lic");

</java>

Parameters
licenseNameCan be a full or short file name<ms> or name of an embedded resource</ms>. Use an empty string to switch to evaluation mode.
License()
Initializes a new instance of this class.
@ NoAuthentication
No authentication