去除 ServiceStack.Redis 的6000次限制。


方法一、

下载

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);

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM