Class Metered

Class Metered

Namn på plats: Aspose.Note Sammanfattning: Aspose.Note.dll (25.4.0)

Tillhandahåller metoder för att ställa in mätade nycklar.

public class Metered

Inheritance

object Metered

Arvsmedlemmar

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

Examples

I det här exemplet kommer det att göras ett försök att ställa in mätade offentliga och privata nycklar

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

Visa hur man ställer in måttlig licens.

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

Få konsumentkrediter.

public static decimal GetConsumptionCredit()

Returns

decimal

Returnerar antalet förbrukade kreditpoäng.

GetConsumptionQuantity()

Få konsumentfil storlek.

public static decimal GetConsumptionQuantity()

Returns

decimal

Returnerar antalet förbrukade byter.

ResetMeteredKey()

Ta bort tidigare installationslicens.

public void ResetMeteredKey()

SetMeteredKey(String och String)

Ställer in offentliga och privata nycklar.

public void SetMeteredKey(string publicKey, string privateKey)

Parameters

publicKey string

Den offentliga nyckeln.

privateKey string

Den privata nyckeln.

Examples

Visa hur man ställer in måttlig licens.

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

Om du köper en måttlig licens, bör denna API kallas på applikationsstart, vanligtvis är detta tillräckligt.Men om mätare misslyckas med att ladda upp förbrukningsdata under en 24 timmars period, kommer licensen att ställas in på utvärderingsstatus. För att undvika sådana fall bör du regelbundet kontrollera licensstatus Om det är utvärderingsstatus, ringa denna API igen.

 Svenska