This flew fine in VB6:
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
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?”