随笔分类 -  C# 编程

摘要:Regex regex = new Regex(@"[\u4e00-\u9fa5]"); // 定义正则表达式,匹配Unicode编码范围内的中文字符 string input = "fefe 年年年 商 eeeeee"; // string matches = regex.Replace(inpu 阅读全文
posted @ 2024-02-29 10:28 探索的动机 阅读(260) 评论(0) 推荐(0)
摘要:#region 压缩和解压字符串 /// <summary> /// 将传入字符串以GZip算法压缩后,返回Base64编码字符 /// </summary> /// <param name="rawString">需要压缩的字符串</param> /// <returns>压缩后的Base64编码 阅读全文
posted @ 2024-02-19 10:57 探索的动机 阅读(386) 评论(0) 推荐(0)
摘要:string url = "http://localhost:5082/cookie/test2"; var cookies = new CookieContainer(); var handler = new HttpClientHandler() { CookieContainer = cook 阅读全文
posted @ 2023-12-21 16:07 探索的动机 阅读(241) 评论(0) 推荐(0)
摘要:using System; using System.Collections.Generic; using System.Text; using System.Linq; using System.Text.RegularExpressions; namespace YiSha.Util { pub 阅读全文
posted @ 2023-11-16 17:00 探索的动机 阅读(18) 评论(0) 推荐(0)
摘要:string[] ip = new string[] { }; ip = IP.Split(new char[] { '!', '@', '#', '$', '%', '^', '&', '*', '(', ')', '_', '-', '=', '+', '/', '\\', ',', '?', 阅读全文
posted @ 2022-10-18 18:46 探索的动机 阅读(27) 评论(0) 推荐(0)
摘要:/// <summary> /// 转换人民币大小金额 /// </summary> /// <param name="num">金额</param> /// <returns>返回大写形式</returns> public static string CmycurD(decimal num) { 阅读全文
posted @ 2022-10-18 18:35 探索的动机 阅读(69) 评论(0) 推荐(0)
摘要:转: https://cloud.tencent.com/developer/article/1416525 阅读全文
posted @ 2022-04-01 22:18 探索的动机 阅读(63) 评论(0) 推荐(0)
摘要:#region 文件分块读取 /// <summary> /// 文件分块读取 /// </summary> /// <param name="filePath">文件路径</param> /// <param name="length">每一次读取的文件大小</param> public stat 阅读全文
posted @ 2022-04-01 22:04 探索的动机 阅读(515) 评论(0) 推荐(0)
摘要:转: https://blog.csdn.net/sunbingzibo/article/details/39996465 阅读全文
posted @ 2022-04-01 22:02 探索的动机 阅读(167) 评论(0) 推荐(0)
摘要:转: https://zhuanlan.zhihu.com/p/38229790 阅读全文
posted @ 2022-04-01 21:57 探索的动机 阅读(47) 评论(0) 推荐(0)
摘要:设计模式分为三种:1、创建型设计模式,关注对象的创建; 2、结构型设计模式,关注类与类之间的关系;3、行为型设计模式,关注对象和行为的分离。 结构型设计模式:Adapter Class/Object (适配器模式) 、Bridge(桥接)、Composite(组合)、Decorator(装饰)、Fa 阅读全文
posted @ 2022-03-20 19:24 探索的动机 阅读(87) 评论(0) 推荐(0)
摘要:https://www.cnblogs.com/Fengge518/p/11776479.html 阅读全文
posted @ 2022-03-19 21:52 探索的动机 阅读(47) 评论(0) 推荐(0)
摘要:1、将.NET Core 项目先在本地发布一下2、使用7-z 将文件压缩成.tar 的格式3、上传到Linux服务器 (使用MobaXterm 工具上传)4、tar -xvf 压缩包文件名称 (如:tar -xvf FaBu.tar) 命令解压压缩包5、使用 docker build -t word 阅读全文
posted @ 2022-03-03 22:30 探索的动机 阅读(217) 评论(0) 推荐(0)
摘要:API 控制器上如果是这样标识[Route("api/[controller]/[action]")]API 接口中不能出现重载方法 Get 方法上加HttpGet 特性 特性中不能使用模板 ,否则会访问不到传递单个参数第一种方法 : 接口上加 HttpGet({id}) 其中id 要和方法参数、U 阅读全文
posted @ 2022-03-03 22:27 探索的动机 阅读(688) 评论(0) 推荐(0)
摘要://反射进行赋值时 防止类型转换异常的标准写法 Type type = Nullable.GetUnderlyingType(propertyInfo.PropertyType); //返回可为空字段的类型 if (type!=null) { propertyInfo.SetValue(model, 阅读全文
posted @ 2022-03-02 23:16 探索的动机 阅读(115) 评论(0) 推荐(0)
摘要:BeginRequset :asp.net 开始处理请求的第一个事件,表示处理的开始; AuthenticateRequset: 验证请求,一般用来取得请求的用户信息; PostAuthenticateRequest:用户请求已获得授权。 ResolveRequestCache: 获取以前处理缓存的 阅读全文
posted @ 2022-02-10 13:49 探索的动机 阅读(85) 评论(0) 推荐(0)
摘要:大致过程如下: 1、IIS得到一个请求 2、查询脚本映射扩展,然后把请求映射aspnet_isapi.dll文件 3、代码进入工作者进程(IIS 5 里是aspnet_wp.exe;IIS6 里是w3wp.exe),工作者进程也叫辅助进程; 4、.NET 运行时被加载; 5、非托管代码调用 Isap 阅读全文
posted @ 2022-02-10 13:36 探索的动机 阅读(202) 评论(0) 推荐(0)
摘要:拦截器Filter 共有五种 Authorization Fileter、Resource Fileter、 Exception Filter 、Action Filter、 Result Filter Exception Filter 当出现异常时进入此方法,可在这针对不同的异常做相关处理并返回指 阅读全文
posted @ 2022-02-08 19:07 探索的动机 阅读(2451) 评论(0) 推荐(0)
摘要:1、ASP.NET 只能部署在Window系统平台上,无法跨平台部署;ASP.NET Core 支持跨平台不仅可以部署在Window操作系统上,也能部署在Lunix操作系统上; 2、ASP.NET属于 大包大揽式的,一旦启动就加载所有的组件,而ASP.NET Core 是需要按需加载,占用资源更少 阅读全文
posted @ 2022-02-07 21:32 探索的动机 阅读(3539) 评论(0) 推荐(0)
摘要:/// <summary> /// 生成随机数字 /// </summary> /// <param name="length">生成长度</param> /// <returns></returns> public static string Number(int Length) { return 阅读全文
posted @ 2022-01-12 20:29 探索的动机 阅读(94) 评论(0) 推荐(0)