メーター付きライセンス

メーター付きライセンス

メータークラスを使用するための簡単な手順は次のとおりです。

  1. メータークラスのインスタンスを作成します。
  2. 公開キーと秘密キーを SetMeteredKey メソッドに渡します。
  3. 処理を行います(タスクを実行します)。
  4. メータークラスの GetConsumptionQuantity メソッドを呼び出します。
  5. これまでに消費した API リクエストの量/数量が返されます。

以下は、メーター付きの公開鍵と秘密鍵を設定する方法を示すサンプルコードです。

// 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
decimal amountbefore = Aspose.CAD.Metered.GetConsumptionQuantity();
// Display information
Console.WriteLine("Amount Consumed Before: " + amountbefore.ToString());
// Do processing
//Aspose.CAD.FileFormats.Cad.CadImage image = (Aspose.CAD.FileFormats.Cad.CadImage)Aspose.CAD.Image.load("BlockRefDgn.dwg");
// Get metered data amount After calling API
decimal amountafter = Aspose.CAD.Metered.GetConsumptionQuantity();
// Display information
Console.WriteLine("Amount Consumed After: " + amountafter.ToString());