Visual Basic Code , VB.NET Code, VB Code
  Home   :  Code   :  Forums   :  Submit   :  Mailing List   :  About   :  Contact
A1VBCode Forums
Home      Members   Calendar   Who's On
Welcome Guest ( Login | Register )
      

Home » .NET Programming » Visual Basic .NET » Convert byte array to String


Convert byte array to StringExpand / Collapse
Author
Message
Posted 9/6/2010 5:55:20 AM


Junior Member

Junior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior Member

Group: Forum Members
Last Login: 6/5/2013 5:34:23 AM
Posts: 19, Visits: 78

How to convert byte array to string . I alreay posted this topic but no response.


Thank you
Post #29608
Posted 9/17/2010 4:55:51 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 9/17/2010 4:48:31 AM
Posts: 4, Visits: 4
Hi ,
Check this Code ..

Public Function ByteArrayToString(bytArray() As Byte) As String
Dim sAns As String
Dim iPos As String

sAns = StrConv(bytArray, vbUnicode)
iPos = InStr(sAns, Chr(0))
If iPos > 0 Then sAns = Left(sAns, iPos - 1)

ByteArrayToString = sAns

End Function
Post #29637
Posted 9/21/2010 1:35:32 AM


Junior Member

Junior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior Member

Group: Forum Members
Last Login: 6/5/2013 5:34:23 AM
Posts: 19, Visits: 78

Hi SaranSaki,

I tried to below code, It's working fine. thanks for your suggestion and response

Dim re As Byte() = e.Result

Dim result As String = System.Text.Encoding.ASCII.GetString(re)

Thanks a lot !!!!

Thank you
Post #29652
« Prev Topic | Next Topic »


Reading This TopicExpand / Collapse
Active Users: 1 (1 guest, 0 members, 0 anonymous members)
No members currently viewing this topic.
Forum Moderators: Admin, Mod, Mark, Keithuk

PermissionsExpand / Collapse

All times are GMT -5:00, Time now is 5:08pm