CSharp examples for System:Byte
String To Bytes
using System.Collections.Generic; using System;/* w w w . j a v a 2 s.c o m*/ public class Main{ private static byte[] StringToBytes(string str) { byte[] bytes = new byte[str.Length * sizeof(char)]; System.Buffer.BlockCopy(str.ToCharArray(), 0, bytes, 0, bytes.Length); return bytes; } }