Class Metered

Class Metered

nazivni prostor: Aspose.Note Sastav: Aspose.Note.dll (25.4.0)

Pružuje metode za postavljanje mjerene ključeve.

public class Metered

Inheritance

object Metered

naslijeđeni članovi

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

Examples

U ovom primjeru, pokušat će se postaviti mjeren javni i privatni ključ

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

Pokaži kako postaviti mjerene dozvole.

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

Dobivaju potrošački kredit.

public static decimal GetConsumptionCredit()

Returns

decimal

Povratak broja potrošenih kreditnih bodova.

GetConsumptionQuantity()

Pronađite veličinu datoteke potrošnje.

public static decimal GetConsumptionQuantity()

Returns

decimal

Povratak broja potrošenih bajtova.

ResetMeteredKey()

Uklanjanje prethodne licencije za postavljanje.

public void ResetMeteredKey()

SetMeteredKey(String, String i String)

Postavlja se javni i privatni ključ.

public void SetMeteredKey(string publicKey, string privateKey)

Parameters

publicKey string

javni ključ.

privateKey string

privatni ključ.

Examples

Pokaži kako postaviti mjerene dozvole.

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

Ako kupite licenciranu licencu, ova API bi trebala biti pozvana na startup aplikacije, obično, to je dovoljno.Međutim, ako mjereni ne prenose podatke o potrošnji tijekom razdoblja od 24 sata, licencija će biti postavljena na stanje ocjenjivanja. da biste izbjegli takav slučaj, trebali biste redovito provjeravati stanje licence Ako je to stanje ocjenjivanja, nazovite ovaj API ponovno.

 Hrvatski