Licenza a Consumo
Contents
[
Hide
]Aspose.CAD consente agli sviluppatori di applicare una chiave a consumo. È un nuovo meccanismo di licenza. Il nuovo meccanismo di licenza sarà utilizzato insieme al metodo di licenza esistente. I clienti che desiderano essere fatturati in base all’uso delle funzionalità dell’API possono utilizzare la licenza a consumo. Per ulteriori dettagli, si prega di fare riferimento alla sezione Domande frequenti sulla licenza a consumo.
Licenza a Consumo
Ecco i semplici passaggi per utilizzare la classe Metered.
- Crea un’istanza della classe Metered.
- Passa le chiavi pubbliche e private al metodo SetMeteredKey.
- Esegui il processo (completa il compito).
- Chiama il metodo GetConsumptionQuantity della classe Metered.
- 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.
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); |