文本转换为字节数组:
Private Function ConvertToByteArray(MyString As String) As Byte()
Return System.Text.Encoding.UTF8.GetBytes(MyString)
End Function
字节数组转换为文本:
Private Function ConvertToString(ByteArray As Byte()) As String
Return System.Text.Encoding.UTF8.GetString(ByteArray)
End Function