我正在做一些项目。我只需要向一台计算机提供该产品的许可证,所以我添加了一个额外的属性硬件Id,如图.How所示,我可以验证它。在这方面帮助我。谢谢..
var license = Portable.Licensing.License.New()
.WithUniqueIdentifier(Guid.NewGuid())
.As(Portable.Licensing.LicenseType.Trial)
.ExpiresAt(DateTime.Now.AddDays(5))
.WithMaximumUtilization(Int32.Parse(User.Text))
.WithAdditionalAttributes(new Dictionary<String,String>{
{"Hardware ID","12343"}
})
.LicensedTo(name.Text, email.Text)
.CreateAndSignWithPrivateKey(privateKey, "212555555");发布于 2016-02-17 10:50:14
我找到了这个很简单的答案。
AssertThat()提供的Portable.Licencing方法。例:-
var validationFailures = licenseContent.Validate() .ExpirationDate() .When(lic => lic.Type == Portable.Licensing.LicenseType.Trial) .And() .AssertThat(lic => lic.Quantity >= 3,failure1) .And() .AssertThat(题为“.And”) "133456",failure1) .When(lic => lic.ProductFeatures.Contains("HardwareID")) .And() .Signature(publicKey) .AssertValidLicense().ToList();https://stackoverflow.com/questions/35450455
复制相似问题