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 مرة أخرى.