Aspose.Tasks for C++
Aspose::Tasks::License Class Referencefinal

Provides methods to license the component. More...

#include <License.h>

Inherits System::Object.

Public Member Functions

 License ()
 Initializes a new instance of the License class. More...
 
void SetLicense (const System::String &licenseName)
 Licenses the component. More...
 
void SetLicense (const System::SharedPtr< System::IO::Stream > &stream)
 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")
License()
Initializes a new instance of the License class.

</ms> <java> the component jar file:

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

</java>

Constructor & Destructor Documentation

◆ License()

Aspose::Tasks::License::License ( )

Initializes a new instance of the License 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

◆ SetLicense() [1/2]

void Aspose::Tasks::License::SetLicense ( const 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() [2/2]

void Aspose::Tasks::License::SetLicense ( const System::String &  licenseName)

Licenses the component.

Parameters
licenseNameCan be a full or short file name or name of an embedded resource. Use an empty string to switch to evaluation mode.

Tries to find the license in the following locations:

1. Explicit path.

<ms>

2. The folder that contains the Aspose component assembly.

3. The folder that contains the client's calling assembly.

4. The folder that contains the entry (startup) 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 that contains the Aspose component JAR file.

3. The folder that contains the client's calling 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");

</ms> <java> the component jar file:

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

</java>