Metered Licensing

Metered Licensing

Here are the simple steps to use the Metered class.

  1. Create an instance of Metered class.
  2. Pass public & private keys to setMeteredKey method.
  3. Do processing (perform task).
  4. call method getConsumptionQuantity of the Metered class.
  5. It will return the amount/quantity of API requests that you have consumed so far.

Following is the sample code demonstrating how to set metered public and private key.

 // Create an instance of PSD Metered class

Aspose.PSD.Metered metered = new Aspose.PSD.Metered();



// Access the setMeteredKey property and pass public and private keys as parameters

metered.SetMeteredKey("*****", "*****");



// Get metered data amount before calling API

decimal amountbefore = Aspose.PSD.Metered.GetConsumptionQuantity();



// Display information

Console.WriteLine("Amount Consumed Before: " + amountbefore.ToString());

// Get metered data amount After calling API

decimal amountafter = Aspose.PSD.Metered.GetConsumptionQuantity();



// Display information

Console.WriteLine("Amount Consumed After: " + amountafter.ToString());