Converting from hex to string

后端 未结 6 704
慢半拍i
慢半拍i 2020-11-27 04:44

I need to check for a string located inside a packet that I receive as byte array. If I use BitConverter.ToString(), I get the bytes a

6条回答
  •  醉酒成梦
    2020-11-27 05:23

    Your reference to "0x31 = 1" makes me think you're actually trying to convert ASCII values to strings - in which case you should be using something like Encoding.ASCII.GetString(Byte[])

提交回复
热议问题