摘要: 作为一名非主修C#的程序员,在此记录下学习与工作中C#的有用内容,持续更新 对类型进行约束,class指定了类型必须是引用类型,new()指定了类型必须具有一个无参的构造函数,规定T类型必须实现IUser,规定T必须为struct where T : class, new(), T:IUser, T 阅读全文
posted @ 2017-04-22 19:45 Hey,Coder! 阅读(531) 评论(0) 推荐(0)
摘要: 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! 阅读(6) 评论(0) 推荐(0)
摘要: 安装 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)
摘要: 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)
摘要: //测试类 var type = typeof(TestClass); //给类对象添加、获取特性 TypeDescriptor.AddAttributes(type, indexAttr); //var attr = TypeDescriptor.GetAttributes(type)[typeo 阅读全文
posted @ 2025-09-22 17:50 Hey,Coder! 阅读(6) 评论(0) 推荐(0)
摘要: public static class FileSafeWrite { public static void WriteAllTextAtomically(string filePath, string content) { // 定义临时文件路径 string tempFilePath = fil 阅读全文
posted @ 2025-09-22 15:05 Hey,Coder! 阅读(12) 评论(0) 推荐(1)
摘要: using System.Collections.Concurrent; internal class Program { static void Main(string[] args) { ConcurrentDictionary<string, RedisConnection> redisCon 阅读全文
posted @ 2025-09-16 18:59 Hey,Coder! 阅读(8) 评论(0) 推荐(0)
摘要: 通过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! 阅读(5) 评论(0) 推荐(0)
摘要: client = new RestClient(new RestClientOptions { RemoteCertificateValidationCallback = (sender, certificate, chain, sslPolicyErrors) => true }); 阅读全文
posted @ 2025-09-04 21:21 Hey,Coder! 阅读(9) 评论(0) 推荐(0)
摘要: webView.CoreWebView2.ServerCertificateErrorDetected += WebView_ServerCertificateErrorDetected; private void WebView_ServerCertificateErrorDetected(obj 阅读全文
posted @ 2025-09-04 21:20 Hey,Coder! 阅读(11) 评论(0) 推荐(0)
摘要: 备份脚本 @echo off REM 获取当前日期和时间,并格式化为 YYYYMMDD_HHMMSS set hour=%time:~0,2% REM 处理小时是个位数的情况(前面带空格的问题),替换空格为0 if "%hour:~0,1%"==" " set hour=0%hour:~1,1% s 阅读全文
posted @ 2025-08-28 09:35 Hey,Coder! 阅读(13) 评论(0) 推荐(0)