Class Metered
De naam: Aspose.Note Verzameling: Aspose.Note.dll (25.4.0)
Geeft methoden om gemeten sleutel te plaatsen.
public class Metered
Inheritance
Geëerbiede leden
object.GetType() , object.MemberwiseClone() , object.ToString() , object.Equals(object?) , object.Equals(object?, object?) , object.ReferenceEquals(object?, object?) , object.GetHashCode()
Examples
In dit voorbeeld zal een poging worden gedaan om een gematigde publieke en private sleutel te plaatsen.
Metered metered = new Metered();
metered.SetMeteredKey("PublicKey", "PrivateKey");
Dim metered As Metered = New Metered
metered.SetMeteredKey("PublicKey", "PrivateKey")
Laat zien hoe u een gemeten licentie instelt.
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()
Geeft consumptiekrediet.
public static decimal GetConsumptionCredit()
Returns
Terugbrengt het aantal geconsumeerde kredietpunten.
GetConsumptionQuantity()
Geeft consumptie bestandsgrootte.
public static decimal GetConsumptionQuantity()
Returns
Hiermee wordt het aantal verbruikte byten teruggebracht.
ResetMeteredKey()
Verwijder voorafgaande installatie licentie.
public void ResetMeteredKey()
SetMeteredKey(String en String)
Stel openbare en private sleutels op.
public void SetMeteredKey(string publicKey, string privateKey)
Parameters
publicKey
string
De openbare sleutel.
privateKey
string
De private sleutel.
Examples
Laat zien hoe u een gemeten licentie instelt.
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
Als u een gemeten licentie koopt, moet deze API op de applicatie start-up worden geroepen, normaal gesproken, dit is genoeg.Als de gemeten echter gedurende een periode van 24 uur geen consumptiegegevens uploaden, wordt de licentie ingesteld op de evaluatiestatus. om dit te voorkomen, moet u de licentiestatus regelmatig controleren Als het evaluatiestatus is, belt u deze API opnieuw.