Class Metered

Class Metered

A név: Aspose.Note Összefoglaló: Aspose.Note.dll (25.4.0)

Megadja a módszereket a mérhető kulcs beállítására.

public class Metered

Inheritance

object Metered

Örökletes tagok

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

Examples

Ebben a példában megpróbáljuk meghatározni a nyilvános és a magán kulcsot

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

Megmutatja, hogyan kell beállítani a mérett licencet.

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

A fogyasztói hitel megszerzése.

public static decimal GetConsumptionCredit()

Returns

decimal

Visszaadja a fogyasztott hitelpontok számát.

GetConsumptionQuantity()

Megkapja a fogyasztási fájl méretét.

public static decimal GetConsumptionQuantity()

Returns

decimal

Visszaadja a fogyasztott bájtok számát.

ResetMeteredKey()

Távolítsa el az előző telepítési engedélyt.

public void ResetMeteredKey()

SetMeteredKey(A string, a string)

Köz- és privát kulcsokat állapít meg.

public void SetMeteredKey(string publicKey, string privateKey)

Parameters

publicKey string

A nyilvános kulcs.

privateKey string

A magán kulcs.

Examples

Megmutatja, hogyan kell beállítani a mérett licencet.

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

Ha mérhető licencet vásárol, ezt az API-t az alkalmazás indítására kell hívni, általában ez elegendő.Ha azonban a mérő nem tölt be a fogyasztási adatokat 24 órás időszakban, a licencet az értékelési állapotra kell beállítani.Egy ilyen eset elkerülése érdekében rendszeresen ellenőriznie kell a licenc állapotát Ha az értékelési állapot, hívja újra ezt az API-t.

 Magyar