Class Metered
Class Metered
이름 공간 : Aspose.Note 모임: Aspose.Note.dll (25.4.0)
측정된 키를 설정하는 방법을 제공합니다.
public class Metered
{
private double _meteredValue;
public double MeteredValue
{
get => _meteredValue;
set => _meteredValue = value;
}
public void Print()
{
Console.WriteLine(_meteredValue);
}
}
Inheritance
상속 회원들
object.GetType() , object.MemberwiseClone() , object.ToString() , object.Equals(object?) , object.Equals(object?, object?) , object.ReferenceEquals(object?, object?) , object.GetHashCode()
Examples
이 예제에서는 공공 및 민간 키를 측정하려는 시도가 이루어질 것입니다.
Metered metered = new Metered();
metered.SetMeteredKey("PublicKey", "PrivateKey");
Dim metered As Metered = New Metered
metered.SetMeteredKey("PublicKey", "PrivateKey")
측정 된 라이센스를 설정하는 방법을 보여줍니다.
Metered meterered = new Metered();
meterered.SetMeteredKey("MyPublicKey", "MyPrivateKey");
Console.WriteLine($"Credit before operation: {Metered.GetConsumptionCredit():F2}");
Console.WriteLine($"Consumption quantity before operation: {Metered.GetConsumptionQuantity():F2}");
string dataDir = RunExamples.GetDataDir_Pages();
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
미터( )
public Metered()
{
}
Methods
상품 간략설명(
소비자 대출을 받는다.
public static decimal GetConsumptionCredit()
{
var consumption = GetTotalConsumption();
var credit = 0m;
if (consumption > MaxConsumption)
credit = MaxAllowableCredit;
else
credit = CalculateCredit(consumption);
return credit;
}
Returns
소비된 신용점의 수를 반환합니다.
사용자 수량( )
소비 파일 크기를 얻습니다.
public static decimal GetConsumptionQuantity()
{
}
Returns
소비된 바이트의 수를 반환합니다.
재설정에 대하여()
이전 설정 라이센스를 제거합니다.
public void ResetMeteredKey()
{
}
세트MeteredKey(스트링, 스트링)
공공 및 민간 열쇠를 설정합니다.
public void SetMeteredKey(
string publicKey,
string privateKey)
{
}
Parameters
publicKey
string
공공의 열쇠
privateKey
string
개인적인 열쇠
Examples
측정 된 라이센스를 설정하는 방법을 보여줍니다.
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}");
string dataDir = RunExamples.GetDataDir_Pages();
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
측정 된 라이센스를 구입하는 경우,이 API는 응용 프로그램 스타트업에 호출되어야합니다, 일반적으로, 이것은 충분합니다.그러나, 측정자가 24 시간 기간 동안 소비 데이터를 업로드하지 못하면, 라이센스는 평가 상태로 설정됩니다.이 경우를 피하려면, 당신은 정기적으로 라이센스 상태를 확인해야합니다.