Class License
Tên không gian: Aspose.Note Tổng hợp: Aspose.Note.dll (25.4.0)
Nó cung cấp các phương pháp để cấp phép các thành phần.
public sealed class License
Inheritance
Thành viên thừa kế
object.GetType() , object.ToString() , object.Equals(object?) , object.Equals(object?, object?) , object.ReferenceEquals(object?, object?) , object.GetHashCode()
Examples
Trong ví dụ này, một nỗ lực sẽ được thực hiện để tìm một tệp giấy phép tên là MyLicense.lictrong thư mục có chứa
thành phần, trong thư mục chứa bộ sưu tập gọi,trong thư mục của hội nhập và sau đó trong các tài nguyên tích hợp của hội nghị gọi.
License license = new License();
license.SetLicense("MyLicense.lic");
Dim license As license = New license
License.SetLicense("MyLicense.lic")
Hiển thị cách tải một giấy phép cho Aspose.Note từ một tệp.
Aspose.Note.License license = new Aspose.Note.License();
license.SetLicense("Aspose.Note.lic");
Hiển thị cách tải một giấy phép cho Aspose.Note từ một dòng.
Aspose.Note.License license = new Aspose.Note.License();
using (FileStream myStream = new FileStream("Aspose.Note.lic", FileMode.Open))
{
license.SetLicense(myStream);
}
Hiển thị cách tải một giấy phép cho Aspose.Note từ nguồn tệp tích hợp.
// Instantiate the License class
Aspose.Note.License license = new Aspose.Note.License();
// Pass only the name of the license file embedded in the assembly
license.SetLicense("Aspose.Note.lic");
Constructors
License()
public License()
Methods
SetLicense(String)
Giấy phép thành phần.
public void SetLicense(string licenseName)
Parameters
licenseName
string
Nó có thể là tên tập tin đầy đủ hoặc ngắn hoặc tên của một tài nguyên tích hợp.Sử dụng một dòng trống để chuyển sang chế độ đánh giá.
Examples
Trong ví dụ này, một nỗ lực sẽ được thực hiện để tìm một tệp giấy phép tên là MyLicense.lictrong thư mục có chứa
thành phần, trong thư mục chứa bộ sưu tập gọi,trong thư mục của hội nhập và sau đó trong các tài nguyên tích hợp của hội nghị gọi.
License license = new License();
license.SetLicense("MyLicense.lic");</code></pre>
Shows how to load a license for Aspose.Note from a file.
```csharp
Aspose.Note.License license = new Aspose.Note.License();
license.SetLicense("Aspose.Note.lic");
Hiển thị cách tải một giấy phép cho Aspose.Note từ nguồn tệp tích hợp.
// Instantiate the License class
Aspose.Note.License license = new Aspose.Note.License();
// Pass only the name of the license file embedded in the assembly
license.SetLicense("Aspose.Note.lic");
Remarks
Cố gắng tìm giấy phép tại các địa điểm sau:
Bước 1: Lối đi rõ ràng
thư mục có chứa bộ sưu tập thành phần Aspose.
thư mục chứa bộ sưu tập gọi của khách hàng.
thư mục chứa bộ sưu tập entry (startup).
Một tài nguyên tích hợp trong bộ gọi của khách hàng.
Trên .NET Compact Framework, bạn cố gắng tìm giấy phép chỉ ở những địa điểm sau:
Bước 1: Lối đi rõ ràng
- một tài nguyên tích hợp trong bộ gọi của khách hàng.
SetLicense(Stream)
Giấy phép thành phần.
public void SetLicense(Stream stream)
Parameters
stream
Stream
Một dòng có chứa giấy phép.
Examples
License license = new License();
license.SetLicense(myStream);
Dim license as License = new License
license.SetLicense(myStream)
Hiển thị cách tải một giấy phép cho Aspose.Note từ một dòng.
WL31_.License license = mới _Wl31.Thuyết minh();sử dụng (FileStream my Stream = mới Filestream(“Aspose.Note.lic”, FileMode.Open)){Giấy phép: SetLicense (myStream)}
#### Remarks
<p>Use this method to load a license from a stream.</p>