C# 添加‘;公司’;向使用C中的portable.licensing的客户发送#
我目前正在使用以下Portable.Licensing()代码生成许可证: 函数LicensedTo()有一个替代定义,它接受一个附加参数:C# 添加‘;公司’;向使用C中的portable.licensing的客户发送#,c#,licensing,C#,Licensing,我目前正在使用以下Portable.Licensing()代码生成许可证: 函数LicensedTo()有一个替代定义,它接受一个附加参数: LicensedTo(string name, string email, Action<Customer> configureCustomer); LicensedTo(字符串名称、字符串电子邮件、操作配置客户); 如何使用此附加参数将“公司名称”与名称和电子邮件一起包含?使用带有附加属性的: var license = License.
LicensedTo(string name, string email, Action<Customer> configureCustomer);
LicensedTo(字符串名称、字符串电子邮件、操作配置客户);
如何使用此附加参数将“公司名称”与名称和电子邮件一起包含?使用带有附加属性的
:
var license = License.New()
.WithUniqueIdentifier(Guid.NewGuid())
//Look here
.WithAdditionalAttributes(new Dictionary<string, string>
{
{"CompanyName", companyName }
})
.As(LicenseType.Trial)
.ExpiresAt(DateTime.Now.AddDays(30))
.WithMaximumUtilization(numberOfUsers)
.LicensedTo(licensedTo, contactEmail)
.CreateAndSignWithPrivateKey(privateKey, passPhrase);
你已经问过这个问题了,提及也会有所帮助。我以前问过这个问题,但因为没有足够的信息而被搁置,甚至在编辑之后也被搁置,所以我用新的措辞问了这个问题。法尔科,好主意。我确实在标题中提到了它,但我现在也在帖子正文中添加了链接。
var license = License.New()
.WithUniqueIdentifier(Guid.NewGuid())
//Look here
.WithAdditionalAttributes(new Dictionary<string, string>
{
{"CompanyName", companyName }
})
.As(LicenseType.Trial)
.ExpiresAt(DateTime.Now.AddDays(30))
.WithMaximumUtilization(numberOfUsers)
.LicensedTo(licensedTo, contactEmail)
.CreateAndSignWithPrivateKey(privateKey, passPhrase);
var fs = new FileStream("license.lic", FileMode.Open);
var license = License.Load(fs);
var name = license.AdditionalAttributes.Get("CompanyName");
fs.Close();