2022年6月13日

测试一次多线程

摘要: 1 using System; 2 using System.Collections.Generic; 3 using System.Diagnostics; 4 using System.Linq; 5 using System.Text; 6 using System.Threading; 7 阅读全文

posted @ 2022-06-13 10:51 泰坦尼克号上的活龙虾 阅读(31) 评论(0) 推荐(0)

2022年6月12日

记一次 缓存 更新

摘要: 1小小应用: Dictionary<string, string> dic = new Dictionary<string, string>(); 2 dic.Add("巴萨主帅", "哈维"); 3 dic.Add("曼城主帅", "瓜迪奥拉"); 4 5 MemoryCache memoryCa 阅读全文

posted @ 2022-06-12 22:35 泰坦尼克号上的活龙虾 阅读(45) 评论(0) 推荐(0)

c#ping IP是否可通讯

摘要: 1 static void Main(string[] args) 2 { 3 string host = "192.168.1.110"; 4 Ping p1 = new Ping(); 5 PingReply reply = p1.Send(host); //发送主机名或Ip地址 6 Strin 阅读全文

posted @ 2022-06-12 22:28 泰坦尼克号上的活龙虾 阅读(70) 评论(0) 推荐(0)

图片格式转换

摘要: 1.图片转换为字节数组 1 /// <summary> 2 /// 将图片以二进制流 3 /// </summary> 4 /// <param name="path"></param> 5 /// <returns></returns> 6 public static byte[] SaveIma 阅读全文

posted @ 2022-06-12 22:21 泰坦尼克号上的活龙虾 阅读(66) 评论(0) 推荐(0)

netcore用静态文件方式显示图片

摘要: 利用静态文件的方式在浏览器中显示本地磁盘图片 在startup中写入如下 1 public void Configure(IApplicationBuilder app, IWebHostEnvironment env) 2 { 3 //判断是否有文件路径 4 if (!Directory.Exis 阅读全文

posted @ 2022-06-12 22:06 泰坦尼克号上的活龙虾 阅读(235) 评论(0) 推荐(0)

2022年6月8日

将本地盘符的图片在浏览器中显示

摘要: 1.打开浏览器 2.在浏览器的地址栏中输入 file:///E:\imges\k1.jpg 3.你E盘中的图片就在浏览器中显示了 阅读全文

posted @ 2022-06-08 14:36 泰坦尼克号上的活龙虾 阅读(96) 评论(0) 推荐(0)

2022年6月7日

截取中间部分字符串

摘要: 截取任意字符中间的字符串,就得用到正则了,否则不好截取/// <summary> /// 获得字符串中开始和结束字符串中间得值 /// </summary> /// <param name="str">字符串</param> /// <param name="s">开始</param> /// <p 阅读全文

posted @ 2022-06-07 09:46 泰坦尼克号上的活龙虾 阅读(134) 评论(0) 推荐(0)

2022年5月26日

获取文件夹下的 所有 txt文件,并将路径写入集合

摘要: /// <summary> /// 获取目录下所有文件名 /// </summary> /// <param name="rootPath">根路径</param> /// <returns></returns> private static List<string> GetFilePathList 阅读全文

posted @ 2022-05-26 15:36 泰坦尼克号上的活龙虾 阅读(134) 评论(0) 推荐(0)

多线程1:Task基本概念

摘要: 恢复内容开始 Task默认使用线程池,也就是我们常说的后台线程:即 当主线程结束,那么创建的tasks任务都会随之结束 如何理解上边的话?我们用一个简单的例子来说明一下:(如下 static void Main(string[] args) { Task.Run(()=>Console.WriteL 阅读全文

posted @ 2022-05-26 15:33 泰坦尼克号上的活龙虾 阅读(73) 评论(0) 推荐(0)

2022年4月20日

int 和 unit 有什么区别

摘要: // // 摘要: // Represents the largest possible value of an System.Int32. This field is constant. public const Int32 MaxValue = 2147483647; // // 摘要: // 阅读全文

posted @ 2022-04-20 11:30 泰坦尼克号上的活龙虾 阅读(608) 评论(0) 推荐(0)

导航