Encode string into Bytes

/ Published in: C#
Save to your folder(s)

Copy this code and paste it in your HTML
  1. private byte[] EncodeMsg(string msg)
  2. {
  3. ASCIIEncoding encoder = new ASCIIEncoding();
  4. byte[] buffer = encoder.GetBytes(msg);
  6. return buffer;
  7. }

Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.