Class Metered

Class Metered

Tên không gian: Aspose.Note Tổng hợp: Aspose.Note.dll (25.4.0)

Cung cấp các phương pháp để đặt chìa khóa đo.

public class Metered

Inheritance

object Metered

Thành viên thừa kế

object.GetType() , object.MemberwiseClone() , 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 để thiết lập chìa khóa công cộng và tư nhân

Metered metered = new Metered();
metered.SetMeteredKey("PublicKey", "PrivateKey");
Dim metered As Metered = New Metered
metered.SetMeteredKey("PublicKey", "PrivateKey")

Hiển thị cách thiết lập giấy phép đo.

Metered metered = new Metered();
                                            metered.SetMeteredKey("MyPublicKey", "MyPrivateKey");

                                            Console.WriteLine($"Credit before operation: {Metered.GetConsumptionCredit():F2}");
                                            Console.WriteLine($"Consumption quantity before operation: {Metered.GetConsumptionQuantity():F2}");

                                            // The path to the documents directory.
                                            string dataDir = RunExamples.GetDataDir_Pages();

                                            // Load OneNote document and get first child           
                                            Document document = new Document(Path.Combine(dataDir, "Aspose.one"));

                                            document.Save(Path.Combine(dataDir, "MeteredLicense.pdf"));

                                            Console.WriteLine($"Credit before operation: {Metered.GetConsumptionCredit():F2}");
                                            Console.WriteLine($"Consumption quantity before operation: {Metered.GetConsumptionQuantity():F2}");

Constructors

Metered()

public Metered()

Methods

GetConsumptionCredit()

Nhận tín dụng tiêu dùng

public static decimal GetConsumptionCredit()

Returns

decimal

Trả lại số điểm tín dụng tiêu thụ.

GetConsumptionQuantity()

Nhận kích thước tệp tiêu thụ.

public static decimal GetConsumptionQuantity()

Returns

decimal

Quay lại số lượng byte đã tiêu thụ.

ResetMeteredKey()

Xóa giấy phép cài đặt trước đó.

public void ResetMeteredKey()

SetMeteredKey(Thẻ, string)

Đặt chìa khóa công cộng và tư nhân.

public void SetMeteredKey(string publicKey, string privateKey)

Parameters

publicKey string

Chìa khóa công cộng

privateKey string

Chìa khóa tư nhân

Examples

Hiển thị cách thiết lập giấy phép đo.

Metered metered = new Metered();
                                            metered.SetMeteredKey("MyPublicKey", "MyPrivateKey");

                                            Console.WriteLine($"Credit before operation: {Metered.GetConsumptionCredit():F2}");
                                            Console.WriteLine($"Consumption quantity before operation: {Metered.GetConsumptionQuantity():F2}");

                                            // The path to the documents directory.
                                            string dataDir = RunExamples.GetDataDir_Pages();

                                            // Load OneNote document and get first child           
                                            Document document = new Document(Path.Combine(dataDir, "Aspose.one"));

                                            document.Save(Path.Combine(dataDir, "MeteredLicense.pdf"));

                                            Console.WriteLine($"Credit before operation: {Metered.GetConsumptionCredit():F2}");
                                            Console.WriteLine($"Consumption quantity before operation: {Metered.GetConsumptionQuantity():F2}");

Remarks

Nếu bạn mua giấy phép đo, API này nên được gọi trên ứng dụng khởi động, bình thường, điều này là đủ.Tuy nhiên, nếu người đo lường không tải dữ liệu tiêu thụ trong khoảng thời gian 24 giờ, giấy phép sẽ được thiết lập cho trạng thái đánh giá. Để tránh trường hợp như vậy, bạn nên kiểm tra trạng thái giấy phép thường xuyên Nếu đó là trạng thái đánh giá, hãy gọi lại API này.

 Tiếng Việt