การอนุญาตแบบมิเตอร์
Contents
[
Hide
]Aspose.CAD ช่วยให้นักพัฒนาสามารถใช้คีย์แบบมิเตอร์ได้ เป็นกลไกการอนุญาตใหม่ กลไกการอนุญาตใหม่จะถูกใช้ควบคู่กับวิธีการอนุญาตที่มีอยู่ ลูกค้าที่ต้องการเรียกเก็บค่าบริการตามการใช้งานฟีเจอร์ API สามารถใช้การอนุญาตแบบมิเตอร์ สำหรับข้อมูลเพิ่มเติม โปรดดูที่ คำถามที่พบบ่อยเกี่ยวกับการอนุญาตแบบมิเตอร์
การอนุญาตแบบมิเตอร์
นี่คือขั้นตอนง่าย ๆ ในการใช้คลาส Metered
- สร้างตัวอย่างของคลาส Metered
- ส่งคีย์สาธารณะและคีย์ส่วนตัวไปยังวิธีการ SetMeteredKey
- ดำเนินการ (ทำงาน)
- เรียกวิธี GetConsumptionQuantity ของคลาส Metered
- มันจะคืนค่าจำนวน API ที่คุณใช้ไปจนถึงตอนนี้
ต่อไปนี้คือโค้ดตัวอย่างที่แสดงวิธีการตั้งค่าคีย์สาธารณะและคีย์ส่วนตัวแบบมิเตอร์
This file contains hidden or 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
import aspose.cad as cad | |
// 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 | |
amountbefore = cad.Metered.get_consumption_quantity() | |
// Display information | |
print("Amount Consumed Before: " + amountbefore.ToString()); | |
// Do processing | |
image = cad.Image.load("file.dwg"); | |
// Get metered data amount After calling API | |
amountafter = cad.Metered.get_consumption_quantity() | |
// Display information | |
print("Amount Consumed After: " + amountafter); |