Class Metered

Class Metered

Nazwa przestrzeń: Aspose.Note Zgromadzenie: Aspose.Note.dll (25.4.0)

Zapewnia metody ustawienia mierzonego klucza.

public class Metered

Inheritance

object Metered

Dziedziczeni członkowie

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

Examples

W tym przykładzie, próba zostanie dokonywana, aby umieścić mierzony publiczny i prywatny klucz

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

Pokaż, jak zainstalować licencję.

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

otrzymuje kredyt konsumpcyjny.

public static decimal GetConsumptionCredit()

Returns

decimal

Zwraca ilość spożywanych punktów kredytowych.

GetConsumptionQuantity()

Dostęp do rozmiaru pliku konsumpcji.

public static decimal GetConsumptionQuantity()

Returns

decimal

Przywróci liczbę spożywanych bajtów.

ResetMeteredKey()

Usunąć licencję wcześniejszej instalacji.

public void ResetMeteredKey()

SetMeteredKey(strumień, strumień)

Zestaw kluczy publicznych i prywatnych.

public void SetMeteredKey(string publicKey, string privateKey)

Parameters

publicKey string

Klucz publiczny .

privateKey string

To prywatny klucz.

Examples

Pokaż, jak zainstalować licencję.

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

Jeśli kupujesz licencję mierzoną, ta API powinna zostać wezwana na startup aplikacji, zwykle to wystarczy.Jednakże, jeśli mierzony nie przesyła danych konsumpcyjnych w ciągu 24 godzin, licencja zostanie ustawiona na status oceny. Aby uniknąć takiego przypadku, należy regularnie sprawdzić status licencji Jeśli jest to status oceny, zadzwoń do tego API ponownie.

 Polski