メーター制ライセンス

メーター制ライセンス

メータークラスを使用するための簡単な手順は以下の通りです。

  1. メータークラスのインスタンスを作成します。
  2. 公開鍵と秘密鍵を SetMeteredKey メソッドに渡します。
  3. 処理を行います(タスクを実行します)。
  4. メータークラスの GetConsumptionQuantity メソッドを呼び出します。
  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);