רישוי מדוד

רישוי מדוד

הנה השלבים הפשוטים לשימוש במחלקת Metered.

  1. צרו מופע של מחלקת Metered.
  2. העבירו את המפתחות הציבוריים והפרטיים למתודת SetMeteredKey.
  3. בצעו עיבוד (בצעו משימה).
  4. קראו למתודת GetConsumptionQuantity של מחלקת Metered.
  5. זה יחזיר את כמות הבקשות API שהשתמשתם בהן עד כה.

להלן דוגמת קוד המדגימה כיצד להגדיר מפתח ציבורי ופרטי מדוד.

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);