Results 1 to 4 of 4

Thread: String To Byte Array

  1. #1

    Thread Starter
    Hyperactive Member LeeSalter's Avatar
    Join Date
    Oct 2002
    Location
    Notts, England
    Posts
    307

    String To Byte Array

    Hello,

    does anybody know how to convert a string to a byte array and vice versa in VB .NET?

    I've looked at the System.Bitconverter class and that seems to be able to convert a byte array to a string, but not a string to a byte array. Any help would be very much appreciated.

    L
    "I'm Brian and so is my Wife"

  2. #2
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    I think it's not forward conversion . but these links maybe helps more !


  3. #3
    Member
    Join Date
    Dec 2002
    Location
    NY, USA
    Posts
    52
    Dim oEncoder As New System.Text.ASCIIEncoding()
    Dim aByte() As Byte = oEncoder.GetBytes(yourstringhere)
    Iouri Boutchkine

  4. #4

    Thread Starter
    Hyperactive Member LeeSalter's Avatar
    Join Date
    Oct 2002
    Location
    Notts, England
    Posts
    307
    Spot on.

    Thanks a lot.
    "I'm Brian and so is my Wife"

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width