Class Metered

Class Metered

De naam: Aspose.Pdf Verzameling: Aspose.PDF.dll (25.4.0)

Geeft methoden om gemeten sleutel te plaatsen.

public class Metered

Inheritance

object Metered

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.

var metered = new Metered();
metered.SetMeteredKey("PublicKey", "PrivateKey");</code></pre>
```csharp
Dim metered As Metered = New Metered
       metered.SetMeteredKey("PublicKey", "PrivateKey")

Toon hoe u een gemeten licentie kunt activeren en credit/consumptie kunt volgen.

// Set metered public and private keys
var metered = new Aspose.Pdf.Metered();
metered.SetMeteredKey("PublicKey", "PrivateKey");
//Get current Consumption Credit and Quantity
var wasCredit = Metered.GetConsumptionCredit();
var wasQuantity = Metered.GetConsumptionQuantity();
//Operate using Aspose.Pdf
var doc = new Document();
doc.Pages.Add();
doc.Save(dataDir + "example.pdf");
//Little wait to be sure the transaction completed
System.Threading.Thread.Sleep(10000);
//Get current Consumption Credit and Quantity
var nowCredit = Metered.GetConsumptionCredit();
var nowQuantity = Metered.GetConsumptionQuantity();
//Show Info
Console.WriteLine("Credit: was={0} now={1} difference={2}", wasCredit, nowCredit, nowCredit - wasCredit);
Console.WriteLine("Quantity: was={0} now={1} difference={2}", wasQuantity, nowQuantity, nowQuantity - wasQuantity);
```<pre><code class="lang-csharp">
' Set metered public And private keys
       Dim metered = New Aspose.Pdf.Metered()
       metered.SetMeteredKey("PublicKey", "PrivateKey")
       'Get current Consumption Credit And Quantity
       Dim wasCredit = Metered.GetConsumptionCredit()
       Dim wasQuantity = Metered.GetConsumptionQuantity()
       'Operate using Aspose.Pdf
       Dim doc = New Document()
       doc.Pages.Add()
       doc.Save(dataDir + "example.pdf")
       'Little wait to be sure the transaction completed
       System.Threading.Thread.Sleep(10000)
       'Get current Consumption Credit And Quantity
       Dim nowCredit = Metered.GetConsumptionCredit()
       Dim nowQuantity = Metered.GetConsumptionQuantity()
       'Show Info
       Console.WriteLine("Credit: was={0} now={1} difference={2}", wasCredit, nowCredit, nowCredit - wasCredit)
       Console.WriteLine("Quantity: was={0} now={1} difference={2}", wasQuantity, nowQuantity, nowQuantity - wasQuantity)

Constructors

Metered()

public Metered()

Methods

GetConsumptionCredit()

Geeft consumptiekrediet.

public static decimal GetConsumptionCredit()

Returns

decimal

De hoeveelheid consumptie.

GetConsumptionQuantity()

Geeft consumptie bestandsgrootte.

public static decimal GetConsumptionQuantity()

Returns

decimal

De hoeveelheid consumptie.

GetProductName()

Krijg de productnaam.

public string GetProductName()

Returns

string

Productnaam

IsMeteredLicensed()

Controleer of de meter is geautoriseerd.

public static bool IsMeteredLicensed()

Returns

bool

Waar of vals

SetMeteredKey(String en String)

Een openbare en privé sleutel.Als u een gemeten licentie koopt, moet deze API bij het starten van de applicatie worden genoemd, normaal gesproken, dit is genoeg.Als de consumptiegegegevens echter niet altijd worden geüpload en 24 uur overschrijdt, wordt de licentie ingesteld op de beoordelingsstatus,Om dit te voorkomen, moet u regelmatig de toestand van de licentie controleren, als het de status van de evaluatie is, belt u deze API opnieuw.

public void SetMeteredKey(string publicKey, string privateKey)

Parameters

publicKey string

openbare sleutel

privateKey string

Privé sleutel

 Nederlands