Class Metered
Название пространства: Aspose.Note Ассоциация: Aspose.Note.dll (25.4.0)
Предлагает методы для установки измеренного ключа.
public class Metered
Inheritance
Наследованные члены
object.GetType() , object.MemberwiseClone() , object.ToString() , object.Equals(object?) , object.Equals(object?, object?) , object.ReferenceEquals(object?, object?) , object.GetHashCode()
Examples
В этом примере будет сделана попытка установить заметный публичный и частный ключ.
Metered metered = new Metered();
metered.SetMeteredKey("PublicKey", "PrivateKey");
Dim metered As Metered = New Metered
metered.SetMeteredKey("PublicKey", "PrivateKey")
Показать, как установить метризованную лицензию.
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()
Получается потребительский кредит.
public static decimal GetConsumptionCredit()
Returns
Возвращает количество потребляемых кредитных пунктов.
GetConsumptionQuantity()
Размер файла потребления.
public static decimal GetConsumptionQuantity()
Returns
Возвращает количество потребляемых байтов.
ResetMeteredKey()
Удаление ранее установленной лицензии.
public void ResetMeteredKey()
SetMeteredKey(Стринг, Стринг)
Составлены публичные и частные ключи.
public void SetMeteredKey(string publicKey, string privateKey)
Parameters
publicKey
string
Общественный ключ .
privateKey
string
Приватный ключ .
Examples
Показать, как установить метризованную лицензию.
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
Если вы покупаете мерную лицензию, этот API должен быть вызван на приложении стартап, обычно этого достаточно.Однако, если измерение не удастся загрузить данные потребления в течение 24 часов, лицензия будет настроен на статус оценки. Чтобы избежать такого случая, нужно регулярно проверять статус лицензии Если это статус оценки, звоните в этот API снова.