Aspose.PSD ช่วยให้นักพัฒนาสามารถใช้คีย์ตามจำนวนการใช้งานได้ นี่คือกลไกใบอนุญาตใหม่ กลไกใบอนุญาตใหม่จะถูกใช้พร้อมกับวิธีการอนุญาตที่มีอยู่ในปัจจุบัน ลูกค้าผู้ที่ต้องการจะเรียกเก็บค่าตามการใช้งานของคุณสมบัติ API สามารถใช้ใบอนุญาตตามจำนวนการใช้งานได้ สำหรับรายละเอียดเพิ่มเติม โปรดอ้างถึงส่วน คำถามที่พบบ่อยเกี่ยวกับการให้ใบอนุญาตตามจำนวนการใช้งาน
ใบอนุญาตตามจำนวนการใช้งาน
นี่คือขั้นตอนง่ายๆ เพื่อใช้คลาส Metered.
- สร้างอินสแตนซ์ของคลาส Metered
- ส่งคีย์สาธารณะและส่วนตัวไปยังของ setMeteredKey method
- ดำเนินการ (ปฏิบัติงาน)
- เรียกเมธอด getConsumptionQuantity ของคลาส Metered
- มันจะส่งคืนปริมาณคำขอ API ที่คุณใช้ไปจนถึงปัจจุบัน
นี่คือโค้ดตัวอย่างที่แสดงวิธีการตั้งค่าคีย์สาธารณะและส่วนตัวของ metered.
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
// Create an instance of PSD Metered class | |
Metered metered = new Metered(); | |
// Access the setMeteredKey property and pass public and private keys as parameters | |
metered.setMeteredKey("*****", "*****"); | |
// Get metered data amount before calling API | |
System.out.println("Amount Consumed Before: " + Metered.getConsumptionQuantity()); | |
// Get metered data amount After calling API | |
System.out.println("Amount Consumed After: " + Metered.getConsumptionQuantity()); | |