随笔分类 -  C# 编程

摘要:Regex regex = new Regex(@"[\u4e00-\u9fa5]"); // 定义正则表达式,匹配Unicode编码范围内的中文字符 string input = "fefe 年年年 商 eeeeee"; // string matches = regex.Replace(inpu 阅读全文
posted @ 2024-02-29 10:28 探索的动机 阅读(178) 评论(0) 推荐(0) 编辑
摘要:#region 压缩和解压字符串 /// <summary> /// 将传入字符串以GZip算法压缩后,返回Base64编码字符 /// </summary> /// <param name="rawString">需要压缩的字符串</param> /// <returns>压缩后的Base64编码 阅读全文
posted @ 2024-02-19 10:57 探索的动机 阅读(272) 评论(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 探索的动机 阅读(163) 评论(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 探索的动机 阅读(4) 评论(0) 推荐(0) 编辑
摘要:string[] ip = new string[] { }; ip = IP.Split(new char[] { '!', '@', '#', '$', '%', '^', '&', '*', '(', ')', '_', '-', '=', '+', '/', '\\', ',', '?', 阅读全文
posted @ 2022-10-18 18:46 探索的动机 阅读(17) 评论(0) 推荐(0) 编辑
摘要:/// <summary> /// 转换人民币大小金额 /// </summary> /// <param name="num">金额</param> /// <returns>返回大写形式</returns> public static string CmycurD(decimal num) { 阅读全文
posted @ 2022-10-18 18:35 探索的动机 阅读(38) 评论(0) 推荐(0) 编辑
摘要:转: https://cloud.tencent.com/developer/article/1416525 阅读全文
posted @ 2022-04-01 22:18 探索的动机 阅读(52) 评论(0) 推荐(0) 编辑
摘要:#region 文件分块读取 /// <summary> /// 文件分块读取 /// </summary> /// <param name="filePath">文件路径</param> /// <param name="length">每一次读取的文件大小</param> public stat 阅读全文
posted @ 2022-04-01 22:04 探索的动机 阅读(460) 评论(0) 推荐(0) 编辑
摘要:转: https://blog.csdn.net/sunbingzibo/article/details/39996465 阅读全文
posted @ 2022-04-01 22:02 探索的动机 阅读(160) 评论(0) 推荐(0) 编辑
摘要:转: https://zhuanlan.zhihu.com/p/38229790 阅读全文
posted @ 2022-04-01 21:57 探索的动机 阅读(37) 评论(0) 推荐(0) 编辑
摘要:设计模式分为三种:1、创建型设计模式,关注对象的创建; 2、结构型设计模式,关注类与类之间的关系;3、行为型设计模式,关注对象和行为的分离。 结构型设计模式:Adapter Class/Object (适配器模式) 、Bridge(桥接)、Composite(组合)、Decorator(装饰)、Fa 阅读全文
posted @ 2022-03-20 19:24 探索的动机 阅读(62) 评论(0) 推荐(0) 编辑
摘要:https://www.cnblogs.com/Fengge518/p/11776479.html 阅读全文
posted @ 2022-03-19 21:52 探索的动机 阅读(35) 评论(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 探索的动机 阅读(201) 评论(0) 推荐(0) 编辑
摘要:API 控制器上如果是这样标识[Route("api/[controller]/[action]")]API 接口中不能出现重载方法 Get 方法上加HttpGet 特性 特性中不能使用模板 ,否则会访问不到传递单个参数第一种方法 : 接口上加 HttpGet({id}) 其中id 要和方法参数、U 阅读全文
posted @ 2022-03-03 22:27 探索的动机 阅读(653) 评论(0) 推荐(0) 编辑
摘要://反射进行赋值时 防止类型转换异常的标准写法 Type type = Nullable.GetUnderlyingType(propertyInfo.PropertyType); //返回可为空字段的类型 if (type!=null) { propertyInfo.SetValue(model, 阅读全文
posted @ 2022-03-02 23:16 探索的动机 阅读(106) 评论(0) 推荐(0) 编辑
摘要:BeginRequset :asp.net 开始处理请求的第一个事件,表示处理的开始; AuthenticateRequset: 验证请求,一般用来取得请求的用户信息; PostAuthenticateRequest:用户请求已获得授权。 ResolveRequestCache: 获取以前处理缓存的 阅读全文
posted @ 2022-02-10 13:49 探索的动机 阅读(74) 评论(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 探索的动机 阅读(182) 评论(0) 推荐(0) 编辑
摘要:拦截器Filter 共有五种 Authorization Fileter、Resource Fileter、 Exception Filter 、Action Filter、 Result Filter Exception Filter 当出现异常时进入此方法,可在这针对不同的异常做相关处理并返回指 阅读全文
posted @ 2022-02-08 19:07 探索的动机 阅读(2386) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示