Logo 
Search:

MS Office Forum

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds

How to Convert ByteArray To String

  Asked By: Jody    Date: Nov 30    Category: MS Office    Views: 1226
  

I wnt to convert one dimensional bytearray to string and display the
data in VB.NET, then how to convert this bytearray into string?

It's very urgent. So, plz reply me if any one have idea abt this.

Share: 

 

1 Answer Found

 
Answer #1    Answered By: Leon Evans     Answered On: Nov 30

Perhaps this is what you need. I put binary/hex bytes into a string
this way. Snipped from my code:

Cmd is a command consisting of all hex bytes that I send out the serial
port.
pref & suff are prefix and suffix for the communications protocol

=======================================
Public Cmd As String
Public pref As String
Public suff As String
...
radio_address = CStr("&H" & ActiveSheet.Range("RadioAddressCell").Value)
suff = Chr(&HFD)
pref = Chr(&HFE) & Chr(&HFE) & Chr(radio_address) & Chr(&HE0)
...
Cmd = pref & Chr(&H5) & freq$ & suff
...
Cmd = Chr(&H16) & Chr(&H47)

 
Didn't find what you were looking for? Find more on How to Convert ByteArray To String Or get search suggestion and latest updates.




Tagged: