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 นี้อีกครั้ง