רישוי מדוד
Contents
[
Hide
]Aspose.CAD מאפשרת למפתחים להשתמש במפתחות מדודים. זוהי מכניקת רישוי חדשה. המכניקה החדשה תעשה שימוש לצד שיטת הרישוי הקיימת. לקוחות שרוצים שהתשלום עבור שימוש בפיצ’רים של ה-API יתבצע על בסיס השימוש יכולים להשתמש ברישוי המדוד. למידע נוסף, אנא הפנו לשאלות נפוצות על רישוי מדוד section.
רישוי מדוד
הנה הצעדים הפשוטים לשימוש במחלקת 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
// For complete examples and data files, please go to https://github.com/aspose-cad/Aspose.CAD-for-Java | |
// Create an instance of OCR Metered class | |
com.aspose.cad.Metered metered = new com.aspose.cad.Metered(); | |
// Access the setMeteredKey property and pass public and private keys as parameters | |
metered.setMeteredKey("<valid pablic key>", "<valid private key>"); | |
// Get consumed qantity value before accessing API | |
double quantityOld = com.aspose.cad.Metered.getConsumptionQuantity(); | |
System.out.println("Consumption quantity" + quantityOld); | |
// DO PROCESSING | |
//com.aspose.cad.fileformats.cad.CadImage image = | |
// (com.aspose.cad.fileformats.cad.CadImage)com.aspose.cad.Image.load("BlockRefDgn.dwg"); | |
// Get consumed qantity value after accessing API | |
double quantity = com.aspose.cad.Metered.getConsumptionQuantity(); | |
System.out.println("Consumption quantity" + quantity()); |