การอนุญาตแบบชั่งน้ำหนัก
Contents
[
Hide
]Aspose.CAD อนุญาตให้ผู้พัฒนาใช้คีย์ชั่งน้ำหนัก นี่เป็นกลไกการอนุญาตใหม่ กลไกการอนุญาตใหม่จะถูกใช้ร่วมกับวิธีการอนุญาตที่มีอยู่ ลูกค้าที่ต้องการถูกเรียกเก็บเงินตามการใช้งานฟีเจอร์ API สามารถใช้การอนุญาตแบบชั่งน้ำหนัก สำหรับรายละเอียดเพิ่มเติม โปรดดูที่ คำถามที่พบบ่อยเกี่ยวกับการอนุญาตแบบชั่งน้ำหนัก
การอนุญาตแบบชั่งน้ำหนัก
นี่คือขั้นตอนง่ายๆ ในการใช้คลาส Metered
- สร้างอินสแตนซ์ของคลาส Metered
- ส่งคีย์สาธารณะและคีย์ส่วนตัวไปยังวิธี SetMeteredKey
- ทำการประมวลผล (ดำเนินการ)
- เรียกใช้วิธี GetConsumptionQuantity ของคลาส Metered
- มันจะคืนค่าจำนวน/ปริมาณของการเรียกขอ API ที่คุณได้ใช้ไปจนถึงตอนนี้
ต่อไปนี้เป็นตัวอย่างโค้ดที่แสดงวิธีการตั้งค่าคีย์สาธารณะและคีย์ส่วนตัวแบบชั่งน้ำหนัก
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
// Access the setMeteredKey property and pass public and private keys as parameters | |
Aspose.CAD.Metered.SetMeteredKey("PublicKey", "PrivateKey"); | |
// Get metered data amount before calling API | |
decimal amountbefore = Aspose.CAD.Metered.GetConsumptionQuantity(); | |
// Display information | |
Console.WriteLine("Amount Consumed Before: " + amountbefore.ToString()); | |
// Do processing | |
//Aspose.CAD.FileFormats.Cad.CadImage image = (Aspose.CAD.FileFormats.Cad.CadImage)Aspose.CAD.Image.load("BlockRefDgn.dwg"); | |
// Get metered data amount After calling API | |
decimal amountafter = Aspose.CAD.Metered.GetConsumptionQuantity(); | |
// Display information | |
Console.WriteLine("Amount Consumed After: " + amountafter.ToString()); | |