Class Metered
Název místa: Aspose.Note Shromáždění: Aspose.Note.dll (25.4.0)
Poskytuje metody pro nastavení měřené klíče.
public class Metered
Inheritance
Dědiční členové
object.GetType() , object.MemberwiseClone() , object.ToString() , object.Equals(object?) , object.Equals(object?, object?) , object.ReferenceEquals(object?, object?) , object.GetHashCode()
Examples
V tomto příkladu se pokusí nastavit měřený veřejný a soukromý klíč.
Metered metered = new Metered();
metered.SetMeteredKey("PublicKey", "PrivateKey");
Dim metered As Metered = New Metered
metered.SetMeteredKey("PublicKey", "PrivateKey")
Ukazuje, jak nastavit měřené licence.
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()
Obdrží spotřební úvěr.
public static decimal GetConsumptionCredit()
Returns
Vrátí počet spotřebovaných kreditních bod.
GetConsumptionQuantity()
Obdrží velikost souboru spotřeby.
public static decimal GetConsumptionQuantity()
Returns
Vrací se počet spotřebovaných bajt.
ResetMeteredKey()
Odstranění předchozího nastavení licence.
public void ResetMeteredKey()
SetMeteredKey(String , String)
Vytvořte veřejné a soukromé klíče.
public void SetMeteredKey(string publicKey, string privateKey)
Parameters
publicKey
string
Veřejný kl.
privateKey
string
Soukromý kl.
Examples
Ukazuje, jak nastavit měřené licence.
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
Pokud si koupíte měřené licence, tento API by měl být volán na start-up aplikace, obvykle, to sta.Nicméně, pokud měřené nedokáže nahrávat údaje o spotřebě po dobu 24 hodin, licence bude nastaven na status hodnocení. Aby se tomu zabránilo, měli byste pravidelně kontrolovat status licence Pokud je to status hodnocení, zavolejte tuto API znovu.