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

Ако купујете меру лиценцу, овај АПИ треба да се позива на апликацији стартап, обично, ово је довољно.Међутим, ако мерени не преузимају податке о потрошачу током периода од 24 сата, лиценца ће бити постављена на статус процене. да би се избегавао такав случај, требало би да редовно проверите статус лиценце Ако је то статус процене, поново позовите ову АПИ.

 Српски