Skip to content

Releases: ldqk/Masuit.Tools

中断性变更

18 Aug 12:59
Compare
Choose a tag to compare

邮箱验证配置项更改为数组格式

原始配置:

"EmailDomainWhiteList": "masuit.com,ldqk.org,[a-zA-Z]{5,32}@qq.com,\\d{6,12}@qq.com,[a-zA-Z0-9]{6,16}@vip.qq.com,\\w{6,36}@foxmail.com,\\w{5,32}@163.com,\\w{5,32}@126.com,\\w{5,32}@msn.com,\\w{6,32}@gmail.com,\\w{6,36}@outlook.com,\\w{6,36}@hotmail.com,\\w{6,36}@sina.com,\\w{6,36}@yeah.net,\\w{6,36}@88.com"
"EmailDomainBlockList": ".*"

变更后:

"EmailDomainWhiteList": ["masuit.com","ldqk.org","[a-zA-Z]{5,32}@qq.com","\\d{6,12}@qq.com","[a-zA-Z0-9]{6,16}@vip.qq.com","\\w{6,36}@foxmail.com","\\w{5,32}@163.com","\\w{5,32}@126.com","\\w{5,32}@msn.com","\\w{6,32}@gmail.com","\\w{6,36}@outlook.com","\\w{6,36}@hotmail.com","\\w{6,36}@sina.com","\\w{6,36}@yeah.net","\\w{6,36}@88.com"]
"EmailDomainBlockList": [".*"]

2025.4.4

22 Jun 10:34
Compare
Choose a tag to compare
  1. 优化ImageBorderRemover
  2. 优化ImageHasher性能和内存占用

2025.4.1

19 Jun 13:25
Compare
Choose a tag to compare
  1. 优化ImageBorderRemover
  2. 新增ColorDeltaE色差比较类

2025.3

18 Jun 07:38
Compare
Choose a tag to compare
  1. 新增图像边框移除器类
  2. 修正获取周的起始日和截止日bug
  3. 修复 SystemInfo.cs 中的空引用异常处理
  4. 优化BodyOrDefault逻辑
  5. 优化WithNoLockInterceptor
  6. linq扩展新增SelectManyAsync,ToSortedSet,AddRangeIf,AppendIf
  7. 优化水印处理
  8. 优化SaveFile
  9. 优化LookupX
  10. 提升ExceptBy性能
  11. 修正农历最近节气不准确的bug
  12. 优化CompareChangesPlus
  13. 优化硬件监控性能,增加读取aida64传感器数据

2024.7

12 Dec 01:38
Compare
Choose a tag to compare
  1. 增加获取指定进程的CPU和内存用量
var process = Process.GetProcessById(1234);
var cpuUsage = process.GetProcessCpuUsage();
var memory = process.GetProcessMemory();

var processes = Process.GetProcessesByName("msedge");
foreach (var p in processes)
{
    var cpu = p.GetProcessCpuUsage();
    var mem = p.GetProcessMemory();
    Console.WriteLine($"Process {p.ProcessName} CPU: {cpu}%, Memory: {mem}MB");
}
  1. 增加System.Text.Json版本序列化反序列化拓展方法支持 #124
var obj = new
{
    Id = 1,
    name = "van",
    addressInfo = new
    {
        street = "123 Main St",
        city = "zcvz",
    },
    remarks = new List<string> { "Deep  Dark  Fantastic", "爱玩游戏♂" },
};

var json = obj.ToJsonString(new JsonSerializerOptions() { Encoder = JavaScriptEncoder.UnsafeRelaxedJsonEscaping });

2024.6.1

09 Dec 12:18
Compare
Choose a tag to compare
  1. 修正普通类转树结构的bug
  2. 增加CompareChanges重载

2024.6

13 Nov 02:03
Compare
Choose a tag to compare
  1. 升级NET9支持
  2. 移除对NET5的支持

2024.5.9

04 Nov 09:31
Compare
Choose a tag to compare
  1. 时间区间判断支持可空时间参数
  2. 新增CompareChanges函数重载
  3. 修正ini文件写入时value特殊值丢失
  4. Newtonsoft.Json扩展支持集合为null时序列化成空集合
  5. 文件类型检测增加visio文件检测
  6. 修正dll和dmg文件检测的bug
  7. Excel获取单元格值扩展函数
  8. ChangeTypeTo增加默认值参数
  9. 文本对比功能下放到.NET 4.6.1可用
  10. 优化.NET Framework 4.5特供版

2024.5

08 Aug 03:35
Compare
Choose a tag to compare
  1. 优化中国农历二十四节气获取
  2. 时间范围快捷获取操作
var weeks=DateTime.Now.GetWeekAmount(); // 获取当前所在年一共有多少周
var week = DateTime.Now.WeekOfYear(); // 获取当前所在年的第几周
var week = DateTime.Now.WeekOfYear(DayOfWeek.Monday); // 获取当前所在年的第几周,并指定星期几是每周第一天

var range = DateTime.Now.GetCurrentWeek(); // 获取当前时间所在周的时间区间:2024-08-05 00:00:00~2024-08-11 23:59:59
var range = DateTime.Now.GetCurrentMonth(); // 获取当前时间所在月的时间区间:2024-08-01 00:00:00~2024-08-31 23:59:59
var range = DateTime.Now.GetCurrentYear(); // 获取当前时间所在年的时间区间:2024-01-01 00:00:00~2024-12-31 23:59:59
var range = DateTime.Now.GetCurrentQuarter(); // 获取当前时间所在季度的时间区间:2024-07-01 00:00:00~2024-09-30 23:59:59
var range = DateTime.Now.GetCurrentLunarMonth(); // 获取当前时间所在农历月的时间区间:2024-08-04 00:00:00~2024-09-02 23:59:59
var range = DateTime.Now.GetCurrentLunarQuarter(); // 获取当前时间所在农历季度的时间区间:2024-08-04 00:00:00~2024-10-31 23:59:59
var range = DateTime.Now.GetCurrentLunarYaer(); // 获取当前时间所在农历年的时间区间:2024-02-10 00:00:00~2025-01-28 23:59:59
var range = DateTime.Now.GetCurrentSolar(); // 获取当前时间所在季节的时间区间:2024-08-07 00:00:00~2024-11-06 23:59:59
var range = DateTime.Now.GetCurrentRange(DateRangeType.Week); // 获取当前时间所在周的时间区间:2024-08-05 00:00:00~2024-08-11 23:59:59
var range = DateTime.Now.GetCurrentRange(DateRangeType.Month); // 获取当前时间所在月的时间区间:2024-08-01 00:00:00~2024-08-31 23:59:59
var range = DateTime.Now.GetCurrentRange(DateRangeType.Quarter); // 获取当前时间所在季度的时间区间:2024-07-01 00:00:00~2024-09-30 23:59:59
var range = DateTime.Now.GetCurrentRange(DateRangeType.Year); // 获取当前时间所在年的时间区间:2024-01-01 00:00:00~2024-12-31 23:59:59
var range = DateTime.Now.GetCurrentRange(DateRangeType.LunarMonth); // 获取当前时间所在农历月的时间区间:2024-08-04 00:00:00~2024-09-02 23:59:59
var range = DateTime.Now.GetCurrentRange(DateRangeType.LunarQuarter); // 获取当前时间所在农历季度的时间区间:2024-08-04 00:00:00~2024-10-31 23:59:59
var range = DateTime.Now.GetCurrentRange(DateRangeType.LunarYear); // 获取当前时间所在农历年的时间区间:2024-02-10 00:00:00~2025-01-28 23:59:59
var range = DateTime.Now.GetCurrentRange(DateRangeType.Solar); // 获取当前时间所在季节的时间区间:2024-08-07 00:00:00~2024-11-06 23:59:59
  1. 新增文本对比功能
var text1 = "<h1>你好 UEditorPlus</h1><p>UEditorPlus 是基于 UEditor 二次开发的富文本编辑器,让 UEditor <span style=\"color: #E36C09;\">焕<span style=\"color: #0070C0;\">然</span><span style=\"color: #31859B;\"><span style=\"color: #00B050;\">一</span><span style=\"color: #FF0000;\">新</span></span></span></p><table data-sort=\"sortDisabled\"><tbody><tr class=\"firstRow\"><td valign=\"top\" style=\"word-break: break-all;\" rowspan=\"1\" colspan=\"3\">我是表格</td></tr><tr><td width=\"273\" valign=\"top\" style=\"word-break: break-all;\">如果</td><td width=\"273\" valign=\"top\" style=\"word-break: break-all;\">有一天</td><td width=\"273\" valign=\"top\" style=\"word-break: break-all;\">我离开了</td></tr><tr><td valign=\"top\" colspan=\"1\" rowspan=\"1\" style=\"word-break: break-all;\">怎么才能</td><td valign=\"top\" colspan=\"1\" rowspan=\"1\" style=\"word-break: break-all;\">证明我</td><td valign=\"top\" colspan=\"1\" rowspan=\"1\" style=\"word-break: break-all;\">曾经来过</td></tr></tbody></table><h2>公式支持</h2><p><img src=\"https://r.latexeasy.com/image.svg?%5Cint%20%5Cfrac%7B1%7D%7Bx%7D%20dx%20%3D%20%5Cln%20%5Cleft%7C%20x%20%5Cright%7C%20%2B%20C\" data-formula-image=\"%5Cint%20%5Cfrac%7B1%7D%7Bx%7D%20dx%20%3D%20%5Cln%20%5Cleft%7C%20x%20%5Cright%7C%20%2B%20C\"/></p><p><br/></p>";
var text2 = "<p>UEditorPlus 是基于 UEditor 二次开发的富文本编辑器,让 UEditor <span style=\"color: #E36C09;\">焕<p style=\"color: #0070C0;\">然</p><span style=\"color: #31859B;\"><span style=\"color: #00B050;\">一</span><span style=\"color: #FF0000;\">新</span></span></span></p><table data-sort=\"sortDisabled\"><tbody><tr class=\"firstRow\"><td valign=\"top\" style=\"word-break: break-all;\" rowspan=\"1\" colspan=\"3\">我是表格</td></tr><tr><td width=\"273\" valign=\"top\" style=\"word-break: break-all;\">如果</td><td width=\"273\" valign=\"top\" style=\"word-break: break-all;\">有一天</td><td width=\"273\" valign=\"top\" style=\"word-break: break-all;\">我离开了</td></tr><tr><td valign=\"top\" colspan=\"1\" rowspan=\"1\" style=\"word-break: break-all;\">怎么才能</td><td valign=\"top\" colspan=\"1\" rowspan=\"1\" style=\"word-break: break-all;\">证明我</td><td valign=\"top\" colspan=\"1\" rowspan=\"1\" style=\"word-break: break-all;\">曾经来过</td></tr></tbody></table><pre class=\"brush:html;toolbar:false\">&lt;div&gt;\r\n&nbsp;&nbsp;&lt;span&gt;这里是HTML标签&lt;/span&gt;\r\n&lt;/div&gt;</pre><h2>公式支持23333333</h2><p><img src=\"https://r.latexeasy.com/image.svg?%5Cint%20%5Cfrac%7B1%7D%7Bx%7D%20dx%20%3D%20%5Cln%20%5Cleft%7C%20x%20%5Cright%7C%20%2B%20C\" data-formula-image=\"%5Cint%20%5Cfrac%7B1%7D%7Bx%7D%20dx%20%3D%20%5Cln%20%5Cleft%7C%20x%20%5Cright%7C%20%2B%20C\"/></p><p><br/></p>";

var (html1, html2) = text1.HtmlDiff(text2); // 对比两段文本并分别生成差异
var diffs = TextDiffer.Compute(text1, text2); // 对比两段文本并分别生成差异详细记录
var patches = DiffPatch.FromDiffs(diffs); // 根据差异信息生成补丁
patches.ToText(); // 根据补丁记录重建文本
(string newText, bool[] results) = patches.Apply(text1); // 将变更补丁应用到原始文本1,并返回是否应用成功
var text1 = diffs.Text1(); // 根据差异信息还原文本1
var text2 = diffs.Text2(); // 根据差异信息还原文本2
var delta = diffs.ToDelta(); // 根据差异信息生成类似于git差异的差分记录
var diffs = text1.FromDelta(delta); // 根据差分信息生成差异记录
  1. 修复雪花id自动获取机器码报错兼容处理
  2. 获取硬盘信息按端口号排序
  3. efcore分页查询增加nolock
  4. 优化ToLookupX函数
  5. 优化可空字典类型

2024.4

01 Jul 07:47
Compare
Choose a tag to compare
  1. 集合扩展增加ToLookupX函数,功能和框架自带的ToLookup差不多,性能比ToLookup好
  2. 优化结构体
  3. 修正Xlsx的ContentType和邮箱脱敏的bug
  4. 修正Tree结构获取Path的bug