Licenza a Consumo

Licenza a Consumo

Ecco i semplici passaggi per utilizzare la classe Metered.

  1. Crea un’istanza della classe Metered.
  2. Passa le chiavi pubbliche e private al metodo SetMeteredKey.
  3. Esegui il processo (completa il compito).
  4. Chiama il metodo GetConsumptionQuantity della classe Metered.
  5. Restituirà l’ammontare/quantità delle richieste API che hai consumato finora.

Di seguito è riportato un codice di esempio che dimostra come impostare la chiave pubblica e privata a consumo.

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