public static byte[] ToByteArray( char[] cs) { byte[] bs = new byte[cs.Length]; for (int i = 0; i < bs.Length; ++i) { bs[i] = Convert.ToByte(cs[i]); } return bs; }