永发信息网

c# 我这个代码怎么输出byte

答案:1  悬赏:40  手机版
解决时间 2021-03-04 17:09
  • 提问者网友:呐年旧曙光
  • 2021-03-03 23:33
private static string CheckSum(byte[] sendByte) { uint a = 0; for (int i = 0; i < sendByte.Length; i++) { a = a + sendByte[i]; } String strHex; strHex = String.Format("{0:X}", a); //转16进制 if (strHex.Length == 2) { return strHex; } if (strHex.Length > 2) //取最后2位 { return strHex.Substring(strHex.Length-2); } return null; } 不要string的 ,
最佳答案
  • 五星知识达人网友:冷風如刀
  • 2021-03-04 00:35
System.Text.Encoding.Unicode.GetBytes(你的字符串);返回byte[]
我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息
大家都在看
推荐资讯