随笔分类 - dotNet
摘要:LINQ 动态排序工具实现原理与应用 一、核心思路 LINQ 动态排序工具的核心是通过字符串来构建动态的排序表达式。主要解决了两个问题: 运行时动态指定排序字段 支持多字段组合排序 二、关键技术点 1. 字符串格式约定 单字段排序:"PropertyName direction" 多字段排序:"Pr
阅读全文
摘要:可以将 .net framework 的执行文件和程序集dll加密打包成一个 exe 文件,带有混淆、防止反编译、授权、试用等等功能,非常强大。 使用方法: 将 exe 拖进 Main Assembly 内容框内,Additional Files 可以添加你的程序集等; Quick Settins
阅读全文
摘要:在 web.config 里 configuration 节点下加上以下配置: <system.webServer> <httpProtocol> <customHeaders> <add name="Access-Control-Allow-Origin" value="*" /> <add na
阅读全文
摘要:public static class MapExtension { public static void Fill(this object src, object dest) { if (src == null || dest == null) return; var srcType = src.
阅读全文
摘要:安装 Serilog public static class LoggerExtension { public static ILogger<T> CreateLogger<T>() { var logPath = "log.txt"; const string outputTemplate = "
阅读全文
摘要:可用于键名匹配规则上。 using System.Text.RegularExpressions; var arr = new[] { "EmailAddress", "BackgroundImage", "EmailAddress1", "EmailAddress21 1", "EmailAddr
阅读全文
摘要:using System.Reflection; string value = "100"; var counter = new Counter(); foreach (var propertyInfo in counter.GetType().GetProperties(BindingFlags.
阅读全文
摘要:Linq 中, GroupBy 之后 OrderBy GroupBy().OrderBy() 是对 Key 进行的排序,所以想要对每组内的 Value 进行排序,需要 Foreach 之内对每个 Group 进行 OrderBy。 代码示例 using System; using System.Co
阅读全文
摘要:基于方糖的微信服务号通知 和 企业微信应用通知 需要安装两个库 RestSharp RestSharp.Serializers.NewtonsoftJson Program.cs 代码如下: using Push.Core.Abstracts; using Push.Core.Implements.
阅读全文
摘要:根据 Microsoft.Extensions.DepdencyInjection 框架简单仿写的一个 DI 框架。 官方地址:https://github.com/dotnet/runtime/tree/main/src/libraries/Microsoft.Extensions.Depende
阅读全文
摘要:基于Quartz.Net通过反射进行任务调度
阅读全文
摘要:作者:l625208058 链接:https://www.jianshu.com/p/cd1be6652570 先 F12 看下 List.Sort() 方法 public void Sort(int index, int count, IComparer<T> comparer); //指定范围排
阅读全文

浙公网安备 33010602011771号