Wednesday, June 4, 2008

I need to convert a string into a Byte Array. How do I code it in Visual Studio?

Visual Studio has Microsoft Visual Basic already referenced and you can use the following code. Of course you need to add an imports statement as shown. This code was tested using Visual Studio 2008.

In this code I am converting the string "Welcome" to a Byte array and writing it to the immediate window.

---
Code follows:


The output of this is:

87
0
101
0
108
0
99
0
111
0
109
0
101
0

No comments: