方法一、

下载

https://github.com/ServiceStack/ServiceStack.Text

修改LicenseUtils.cs文件中的AssertValidUsage

var licensedFeatures = ActivatedLicenseFeatures();

后面添加   return;

 

方法二、调用下面的代码之后就没有了限制

var licenseKey = new LicenseKey()
{
Ref = "pedoc",
Expiry = DateTime.Now.AddDays(365 * 5),
Hash = string.Empty,
Name = "pedoc",
Type = LicenseType.Enterprise
};
var field = typeof(LicenseUtils).GetField("__activatedLicense",
BindingFlags.Static | BindingFlags.NonPublic);
var keyType = field.FieldType;
var constructorInfos = keyType.GetConstructors(BindingFlags.Instance | BindingFlags.NonPublic);
var constructorInfo = constructorInfos[0];
var key = constructorInfo.Invoke(new object[] { licenseKey });
field.SetValue(null, key);
var licenceAll = LicenseUtils.HasLicensedFeature(LicenseFeature.All);
Debug.Assert(licenceAll);

 

转载于:https://www.cnblogs.com/onecool/p/10132488.html

Logo

开放原子开发者工作坊旨在鼓励更多人参与开源活动,与志同道合的开发者们相互交流开发经验、分享开发心得、获取前沿技术趋势。工作坊有多种形式的开发者活动,如meetup、训练营等,主打技术交流,干货满满,真诚地邀请各位开发者共同参与!

更多推荐