示例#1
0
        public byte[] Decode(string data)
        {
            byte[]        binary  = null;
            BinaryEncoder encoder = new BinaryEncoder();

            try
            {
                switch (m_EncodeForamt)
                {
                case Algorithm.StringTransformationFormat.Base64:
                {
                    binary = encoder.DecodeDataFromBase64(data);
                    break;
                }

                case Algorithm.StringTransformationFormat.UTF8:
                {
                    binary = encoder.DecodeDataFromUTF8(data);
                    break;
                }
                }
            }
            catch (Exception)
            {
                throw;
            }
            return(binary);
        }