03 2025 档案

摘要:SetPixel和GetPixel private void btnC_Click(object sender, RoutedEventArgs e) { OpenFileDialog dia = new OpenFileDialog(); dia.Filter = "图像文件|*.png;*.bm 阅读全文
posted @ 2025-03-30 11:21 JohnYang819 阅读(57) 评论(0) 推荐(0)
摘要:var buffer = new byte[1024]; using (var ms = new MemoryStream(buffer)) { //xxx } 原因是buffer的长度过短,当接受到的字节流长度大于1024时,读不完整。 修改为: int len = 1024 * 1024 * 1 阅读全文
posted @ 2025-03-25 17:29 JohnYang819 阅读(123) 评论(0) 推荐(0)
摘要:private static System.Text.RegularExpressions.Regex regex = new Regex("([\u0000-\uffff])"); private static System.Text.RegularExpressions.Regex cRegex 阅读全文
posted @ 2025-03-15 14:24 JohnYang819 阅读(250) 评论(0) 推荐(0)
摘要:private static void DealA(object sender, UnhandledExceptionEventArgs e) { Console.WriteLine($"Exception A Catches it!"); } private static void DealB(o 阅读全文
posted @ 2025-03-14 21:01 JohnYang819 阅读(76) 评论(0) 推荐(0)
摘要:byte[] bytes = { 1,3 }; short s = BitConverter.ToInt16(bytes,0); Console.WriteLine(s); 从低位到高位填充: 0000 0003 0000 0001 3*2^8+1=769; byte[] bytes = { 0x2 阅读全文
posted @ 2025-03-09 10:26 JohnYang819 阅读(170) 评论(0) 推荐(0)