Class Metered
Le nom : Aspose.Note Assemblée: Aspose.Note.dll (25.4.0)
Fornisce metodi per impostare la chiave misurata.
public class Metered
Inheritance
I membri ereditari
object.GetType() , object.MemberwiseClone() , object.ToString() , object.Equals(object?) , object.Equals(object?, object?) , object.ReferenceEquals(object?, object?) , object.GetHashCode()
Examples
In questo esempio, verrà fatto un tentativo di impostare una chiave pubblica e privata misurata
Metered metered = new Metered();
metered.SetMeteredKey("PublicKey", "PrivateKey");
Dim metered As Metered = New Metered
metered.SetMeteredKey("PublicKey", "PrivateKey")
Découvrez comment définir une licence métrée.
Metered metered = new Metered();
metered.SetMeteredKey("MyPublicKey", "MyPrivateKey");
Console.WriteLine($"Credit before operation: {Metered.GetConsumptionCredit():F2}");
Console.WriteLine($"Consumption quantity before operation: {Metered.GetConsumptionQuantity():F2}");
// The path to the documents directory.
string dataDir = RunExamples.GetDataDir_Pages();
// Load OneNote document and get first child
Document document = new Document(Path.Combine(dataDir, "Aspose.one"));
document.Save(Path.Combine(dataDir, "MeteredLicense.pdf"));
Console.WriteLine($"Credit before operation: {Metered.GetConsumptionCredit():F2}");
Console.WriteLine($"Consumption quantity before operation: {Metered.GetConsumptionQuantity():F2}");
Constructors
Metered()
public Metered()
Methods
GetConsumptionCredit()
Riceviamo un credito di consumo.
public static decimal GetConsumptionCredit()
Returns
Ritorna il numero di punti di credito consumati.
GetConsumptionQuantity()
Ottieni la dimensione del file di consumo.
public static decimal GetConsumptionQuantity()
Returns
Ritorna il numero di byte consumati.
ResetMeteredKey()
Rimuovere la licenza di impostazione precedente.
public void ResetMeteredKey()
SetMeteredKey(String et String)
Le chiavi pubbliche e private.
public void SetMeteredKey(string publicKey, string privateKey)
Parameters
publicKey
string
La chiave pubblica.
privateKey
string
La chiave privata.
Examples
Découvrez comment définir une licence métrée.
Metered metered = new Metered();
metered.SetMeteredKey("MyPublicKey", "MyPrivateKey");
Console.WriteLine($"Credit before operation: {Metered.GetConsumptionCredit():F2}");
Console.WriteLine($"Consumption quantity before operation: {Metered.GetConsumptionQuantity():F2}");
// The path to the documents directory.
string dataDir = RunExamples.GetDataDir_Pages();
// Load OneNote document and get first child
Document document = new Document(Path.Combine(dataDir, "Aspose.one"));
document.Save(Path.Combine(dataDir, "MeteredLicense.pdf"));
Console.WriteLine($"Credit before operation: {Metered.GetConsumptionCredit():F2}");
Console.WriteLine($"Consumption quantity before operation: {Metered.GetConsumptionQuantity():F2}");
Remarks
Se si acquista una licenza misurata, questa API dovrebbe essere chiamata su applicazione startup, di solito, questo è sufficiente.Tuttavia, se i moderati non riescono a caricare i dati di consumo per un periodo di 24 ore, la licenza verrà impostata allo stato di valutazione.Per evitare questo caso, dovresti controllare regolarmente lo stato di licenza Se si tratta dello stato di valutazione, chiamare questa API di nuovo.