随笔分类 -  C# 常用算法、技巧

摘要:// string to enum EAccountRole var = (EAccountRole)Enum.Parse(typeof(EAccountRole), RoleManage.Instance.CurrentAccount.Role); // enum to list public I 阅读全文
posted @ 2023-02-25 13:09 耕耘理想的农夫 阅读(78) 评论(0) 推荐(0)
摘要:Console.Write(f.ToString("X2") + " ")); byte[] b1 = new byte[100]; Array.Copy(picBuffers, 0, b1, 0, 100); Console.WriteLine("b1 => "); b1.ToList().For 阅读全文
posted @ 2022-10-14 11:11 耕耘理想的农夫 阅读(120) 评论(0) 推荐(0)
摘要:背景:根据TCP协议,获取byte[]数据,计算数据帧编号 1. recdata[8] 为数据帧编号long frameindex = recdata[8] & 0xFF; 2. recdata[] 中 8、9 两个byte为数据帧编号,高位在前long frameindex = (recdata[ 阅读全文
posted @ 2022-10-14 10:59 耕耘理想的农夫 阅读(1511) 评论(0) 推荐(0)