protected static byte[] setString(string value) { int len = value.Length + (4 - value.Length % 4); if (len <= value.Length) len = len + 4; byte[] msg = new byte[len]; var bytes = Encoding.ASCII.GetBytes(value); bytes.CopyTo(msg, 0); return msg; }