Metered Licensing
Contents
[
Hide
]
Aspose.Imaging allows developers to apply metered key. It is a new licensing mechanism. The new licensing mechanism will be used along with existing licensing method. Those customers who want to be billed based on the usage of the API features can use the metered licensing. For more details, please refer to Metered Licensing FAQ section.
Metered Licensing
Here are the simple steps to use the Metered class.
- Create an instance of Metered class.
- Pass public & private keys to setMeteredKey method.
- Do processing (perform task).
- call method getConsumptionQuantity of the Metered class.
- 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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Aspose.Imaging; | |
using System.Collections.Generic; | |
using System.IO; | |
string templatesFolder = @"c:\Users\USER\Downloads\templates"; | |
string dataDir = templatesFolder; | |
string fileName = Path.Combine(dataDir, "Conholdate.Total.Product.Family.lic"); | |
Aspose.Imaging.Metered metered = new Aspose.Imaging.Metered(); | |
try | |
{ | |
//Specify public and private metered keys | |
metered.SetMeteredKey("", ""); | |
//getConsumptionQuantity of the Metered class. | |
var credit = Aspose.Imaging.Metered.GetConsumptionCredit(); | |
var quanity = Aspose.Imaging.Metered.GetConsumptionQuantity(); | |
} | |
catch (System.ArgumentNullException e) | |
{ | |
System.Console.WriteLine("Need to set public and private metered keys, please request them"); | |
} |