以前做过一篇 Aspose.Cells 8.6.3 的破解(http://www.52pojie.cn/thread-453082-1-1.html)
现在发现我还要用上 Aspose.Email (发现确实比 OpenPop 要强大很多,而且文档比较完善~)
所以再放个 Aspose.Email 6.1.0.0 的热补丁啦
Aspose 官网:http://www.aspose.com/
Aspose.Email 官网:http://www.aspose.com/.net/email-component.aspx
注意:以下代码只保证适用于 Aspose.Email 6.1.0.0 其他版本的文件我没看!
只需在使用之前运行一次这段 Hot Patch 即可(不要去调用 SetLicense())
Aspose.Email 的下载链接就不放了,用 Nuget 装就行
[C#] 纯文本查看 复制代码
private static void PatchAsposeEmail()
{
string name = Assembly.CreateQualifiedName(typeof(Aspose.Email.License).Assembly.FullName, "\u0008\u2002\u2005");
Type licType = Type.GetType(name, false, false);
if (licType == null) {
throw new NotSupportedException("Unsupported version of Aspose.Email");
}
object lic = Activator.CreateInstance(licType);
int findCount = 0;
foreach (FieldInfo field in licType.GetFields(BindingFlags.NonPublic | BindingFlags.Static | BindingFlags.Instance)) {
if (field.FieldType == typeof (int) && field.Name == "\u0002") {
field.SetValue(lic, (int)256);
++findCount;
}
else if (field.FieldType.Name == "\u0002\u2000" && field.Name == "\u0008") {
field.SetValue(lic, (int)1);
++findCount;
}
else if (field.FieldType.Name == "\u0006\u2002\u2005" && field.Name == "\u0002\u2000") {
field.SetValue(lic, (int)1);
++findCount;
}
else if (field.FieldType.Name == "\u0008\u2002\u2005" && field.Name == "\u0005\u2000") {
field.SetValue(null, lic);
++findCount;
}
}
if (findCount < 4) {
throw new NotSupportedException("Unsupported version of Aspose.Email");
}
}
|