Licencjonowanie z pomiarem

Licencjonowanie z pomiarem

Oto proste kroki, aby użyć klasy Metered.

  1. Utwórz instancję klasy Metered.
  2. Przekaż klucze publiczny i prywatny do metody SetMeteredKey.
  3. Wykonaj przetwarzanie (wykonaj zadanie).
  4. Wywołaj metodę GetConsumptionQuantity klasy Metered.
  5. Zwróci ona ilość zapytań API, które do tej pory wykorzystałeś.

Poniżej znajduje się przykładowy kod demonstrujący, jak ustawić publiczny i prywatny klucz z pomiarem.

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