רישוי מדוד
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); |