This flew fine in VB6:
Code:
Dim Text As String
Dim abytText() As Byte
Text = "Some Text"
abytText = InText ' abytText is now an array of bytes holding the text.
But in
VB.NET â05, using
Code:
Dim data As String = "Some Stuff"
Dim aByteText() As Byte = data
causes a blue warning squiggle under the reference to the variable data. When I hover over it, the tip says, "Value of type 'String' cannot be converted to '1-dimensional array of Byte'."
I believe that if I used a conversion function to type Byte, it would argue because a string can't be recognized as a single-byte value. As they used to say in commercials for Jiff (gender notwithstanding), âWhatâs a mother to do?â