如何将tcp通讯中的字节流byte[ ]中 01 e2 40 转换为 string ”123456“通讯报文是西门子 S7的通讯报文
byte[] bs =new byte[]{0x01,0xe2,0x40};int res =0;for(int i=0;i<bs.Length;i++){res = res | (bs[i] << ((bs.Length-1-i) * 8));}
Console.WriteLine(res);
纯手工敲,如果错误,做下修改