Class Metered

Class Metered

Името на пространството: Aspose.Note Асамблея: Aspose.Note.dll (25.4.0)

Осигурява методи за определяне на измервания ключ.

public class Metered

Inheritance

object Metered

наследници

object.GetType() , object.MemberwiseClone() , object.ToString() , object.Equals(object?) , object.Equals(object?, object?) , object.ReferenceEquals(object?, object?) , object.GetHashCode()

Examples

В този пример ще бъде направен опит да се поставят насочени публични и частни ключове

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

Показва как да се създаде метър лиценз.

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()

Получаване на потребителски кредит.

public static decimal GetConsumptionCredit()

Returns

decimal

Възстановява броя на консумираните кредитни точки.

GetConsumptionQuantity()

Получава размера на файла за потребление.

public static decimal GetConsumptionQuantity()

Returns

decimal

Възстановява броя на консумираните байтове.

ResetMeteredKey()

Премахване на предишна лиценза за настройка.

public void ResetMeteredKey()

SetMeteredKey(Стрийк, Стрийк)

Създаване на публични и частни ключове.

public void SetMeteredKey(string publicKey, string privateKey)

Parameters

publicKey string

Публичен ключ .

privateKey string

Частният ключ

Examples

Показва как да се създаде метър лиценз.

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

Ако купувате лиценз, този API трябва да се обади на стартиране на приложения, обикновено това е достатъчно.24-часов период, лицензът ще бъде зададен към състоянието на оценката.За да се избегне такъв случай, трябва редовно да проверите състоянието на лиценза Ако това е състоянието на оценката, обадете се отново на този API.

 Български