Results 1 to 5 of 5

Thread: how to convert a string to byte array?

  1. #1

    Thread Starter
    yay gay PT Exorcist's Avatar
    Join Date
    Apr 2002
    Location
    . . . my reason of shame
    Posts
    2,729

    Lightbulb how to convert a string to byte array?

    i cant find any method to do that..how should i do it? i can only find one to put it as char array!
    \m/\m/

  2. #2
    Fanatic Member
    Join Date
    Oct 2000
    Location
    Reading, UK
    Posts
    870
    isn't a byte array an array of 1's and 0's?
    why would you want to out a string in that?
    www.vb-tech.com
    .Net Freelance Development
    http://weblog.vb-tech.com/nick
    My blog

  3. #3
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    You can serialize it.

  4. #4
    PowerPoster Lethal's Avatar
    Join Date
    Oct 2000
    Location
    Ohio
    Posts
    2,496
    Code:
    string s = "Hello World";
    byte[] b = System.Text.UnicodeEncoding.Unicode.GetBytes(s);

  5. #5

    Thread Starter
    yay gay PT Exorcist's Avatar
    Join Date
    Apr 2002
    Location
    . . . my reason of shame
    Posts
    2,729
    Originally posted by Lethal
    Code:
    string s = "Hello World";
    byte[] b = System.Text.UnicodeEncoding.Unicode.GetBytes(s);
    yeah..that was what i was looking for
    \m/\m/

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