Friday, June 5, 2009

Converting a Byte Array to a String in VB.NET

Here is one way to convert a byte array to a String in VB.NET:


Dim bArray() As Byte = {65, 66, 67, 68, 69}
Dim str As String
str = System.Text.Encoding.ASCII.GetString(bArray)



More examples of converting Byte Arrays to Strings and vice versa in VB.NET and C# can be found here:

http://www.chilkatsoft.com/faq/DotNetStrToBytes.html

No comments: