Class Metered
Contents
[
Hide
]Metered class
Provides methods to set metered key.
public class Metered
Constructors
Name | Description |
---|---|
Metered() | The default constructor. |
Methods
Name | Description |
---|---|
ResetMeteredKey() | Removes previously setup license. |
SetMeteredKey(string, string) | Sets metered public and private keys. |
static GetConsumptionCredit() | Gets consumption credit. |
static GetConsumptionQuantity() | Gets consumption file size. |
Examples
In this example, an attempt will be made to set metered public and private key
[C#]
Metered metered = new Metered();
metered.SetMeteredKey("PublicKey", "PrivateKey");
[Visual Basic]
Dim metered As Metered = New Metered
metered.SetMeteredKey("PublicKey", "PrivateKey")
Shows how to set metered license.
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}");
See Also
- namespace Aspose.Note
- assembly Aspose.Note