Class Metered
Nombre del espacio: Aspose.Note Asamblea: Aspose.Note.dll (25.4.0)
Proporciona métodos para configurar la llave medida.
public class Metered
Inheritance
Miembros heredados
object.GetType() ,y, object.MemberwiseClone() ,y, object.ToString() ,y, object.Equals(object?) ,y, object.Equals(object?, object?) ,y, object.ReferenceEquals(object?, object?) ,y, object.GetHashCode()
Examples
En este ejemplo, se hará un intento de establecer una llave pública y privada marcada
Metered metered = new Metered();
metered.SetMeteredKey("PublicKey", "PrivateKey");
Dim metered As Metered = New Metered
metered.SetMeteredKey("PublicKey", "PrivateKey")
Mostra cómo configurar una licencia de medida.
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()
Obtenga crédito de consumo.
public static decimal GetConsumptionCredit()
Returns
devolver el número de puntos de crédito consumidos.
GetConsumptionQuantity()
Recibe el tamaño del archivo de consumo.
public static decimal GetConsumptionQuantity()
Returns
devolver el número de bits consumidos.
ResetMeteredKey()
Elimina la licencia de configuración anterior.
public void ResetMeteredKey()
SetMeteredKey(Título, Título)
Tiene las claves públicas y privadas.
public void SetMeteredKey(string publicKey, string privateKey)
Parameters
publicKey
string
La clave pública.
privateKey
string
La clave privada.
Examples
Mostra cómo configurar una licencia de medida.
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
Si usted compra una licencia medida, esta API debe ser llamado en la startup de la aplicación, por lo general, esto es suficiente.No obstante, si la medida no descarga los datos de consumo durante un período de 24 horas, la licencia se ajustará al estado de evaluación.Para evitar este caso, debe verificar periódicamente el estado de licencia Si es el estado de evaluación, llame esta API de nuevo.