会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
0x0c,0x0d
Write The CODE,Change The World!
首页
新随笔
联系
管理
[置顶]
C#技巧记录——持续更新
摘要: 作为一名非主修C#的程序员,在此记录下学习与工作中C#的有用内容,持续更新 对类型进行约束,class指定了类型必须是引用类型,new()指定了类型必须具有一个无参的构造函数,规定T类型必须实现IUser,规定T必须为struct where T : class, new(), T:IUser, T
阅读全文
posted @ 2017-04-22 19:45 Hey,Coder!
阅读(535)
评论(0)
推荐(0)
2025年11月4日
c# 根据指定字段去重
摘要: public static class DistinctEx { /// <summary> /// 根据指定字段去重 /// </summary> /// <typeparam name="TSource"></typeparam> /// <typeparam name="TKey"></typ
阅读全文
posted @ 2025-11-04 14:27 Hey,Coder!
阅读(3)
评论(0)
推荐(0)
2025年10月13日
C# sqlSugar 无实体操作
摘要: private SqlSugarClient GetDB() { SqlSugarClient db = new SqlSugarClient(new ConnectionConfig() { ConnectionString = "Host=127.0.0.1;Database=test;User
阅读全文
posted @ 2025-10-13 15:01 Hey,Coder!
阅读(13)
评论(0)
推荐(0)
2025年10月9日
自建docker hub -- docker registry
摘要: 安装 docker run -dp 5000:5000 --restart=always --name oldboyedu-registry -v /var/lib/registry:/var/lib/registry registry:2 验证服务 curl http://127.0.0.1:50
阅读全文
posted @ 2025-10-09 11:44 Hey,Coder!
阅读(4)
评论(0)
推荐(0)
2025年9月25日
c# List<dynamic> 按字段排序
摘要: public static List<dynamic> OrderByKey (this IList<dynamic> list, string propertyName, bool isDescending = false) { var propertyInfo = list[0].GetType
阅读全文
posted @ 2025-09-25 13:27 Hey,Coder!
阅读(6)
评论(0)
推荐(0)
2025年9月22日
c# 反射动态添加Attribute
摘要: //测试类 var type = typeof(TestClass); //给类对象添加、获取特性 TypeDescriptor.AddAttributes(type, indexAttr); //var attr = TypeDescriptor.GetAttributes(type)[typeo
阅读全文
posted @ 2025-09-22 17:50 Hey,Coder!
阅读(13)
评论(0)
推荐(0)
c# 保存文件 - 断电过程中保存文件丢失
摘要: public static class FileSafeWrite { public static void WriteAllTextAtomically(string filePath, string content) { // 定义临时文件路径 string tempFilePath = fil
阅读全文
posted @ 2025-09-22 15:05 Hey,Coder!
阅读(16)
评论(0)
推荐(1)
2025年9月16日
c# ConcurrentDictionary
摘要: using System.Collections.Concurrent; internal class Program { static void Main(string[] args) { ConcurrentDictionary<string, RedisConnection> redisCon
阅读全文
posted @ 2025-09-16 18:59 Hey,Coder!
阅读(9)
评论(0)
推荐(0)
2025年9月10日
pg 解析select语句的返回值
摘要: 通过pg_typeof //基础示例 SELECT pg_typeof(id) FROM t_basic_config LIMIT 1; //多表join SELECT pg_typeof(a.id),pg_typeof(b.user_password) FROM t_basic_config a
阅读全文
posted @ 2025-09-10 21:14 Hey,Coder!
阅读(6)
评论(0)
推荐(0)
2025年9月4日
restsharp忽略证书
摘要: client = new RestClient(new RestClientOptions { RemoteCertificateValidationCallback = (sender, certificate, chain, sslPolicyErrors) => true });
阅读全文
posted @ 2025-09-04 21:21 Hey,Coder!
阅读(12)
评论(0)
推荐(0)
webview2忽略证书
摘要: webView.CoreWebView2.ServerCertificateErrorDetected += WebView_ServerCertificateErrorDetected; private void WebView_ServerCertificateErrorDetected(obj
阅读全文
posted @ 2025-09-04 21:20 Hey,Coder!
阅读(13)
评论(0)
推荐(0)
下一页
公告