A
Aaron
How converts a string to a byte and then add it to a byte array? I
tried 2 different methods and both failed to work.
For example:
Dim A as string
Dim B(2) as Byte 'array (from 0 to 2)
A="7B"
B(0) = convert.Tobyte(A)'ERROR1
B(1) = Encoding.ASCII.GetBytes(A)'Error 2
B(2) = Hex("00")
'Error msg1
'An unhandled exception of type 'System.FormatException' occurred in
mscorlib.dll
'Additional information: Input string was not in a correct format.
'-----------
'Error msg 2
'Value of type '1-dimensional array of Byte' cannot be converted to
'Byte'.
tried 2 different methods and both failed to work.
For example:
Dim A as string
Dim B(2) as Byte 'array (from 0 to 2)
A="7B"
B(0) = convert.Tobyte(A)'ERROR1
B(1) = Encoding.ASCII.GetBytes(A)'Error 2
B(2) = Hex("00")
'Error msg1
'An unhandled exception of type 'System.FormatException' occurred in
mscorlib.dll
'Additional information: Input string was not in a correct format.
'-----------
'Error msg 2
'Value of type '1-dimensional array of Byte' cannot be converted to
'Byte'.