I am reading data from a socket (as bytes) and storing this data in a string. Then later i need to access specific bytes within the string and do some math with them. However the bytes that I read back from the string are not what I am expecting.
Here's code to demonstrate my problem:
Dim bytTest() As Byte = {131, 0}
Dim strTest As String
strTest = System.Text.ASCIIEncoding.ASCII.GetString(bytTest)
MsgBox(bytTest(0) & " = " & Asc(strTest.Substring(0, 1)))
This produces "131 = 63", but I would have expected it to produce "131 = 131". Can somebody explain to me why and how I can fix this? Thanks