/// <summary>
        /// 将字节数组反序列化为 Configuration
        /// </summary>
        /// <param name="bytes"></param>
        /// <returns></returns>
        public static async Task <Configuration> DeserializeObjectAsync(byte[] bytes)
        {
            //利用传来的byte[]创建一个内存流
            MemoryStream ms = new MemoryStream(bytes);

            ms.Position = 0;
            BinaryFormatter            formatter = new BinaryFormatter();
            SerializationConfiguration obj       = formatter.Deserialize(ms) as SerializationConfiguration; //把内存流反序列成对象

            ms.Close();
            return(await obj.AsConfigurationAsync());
        }
        /// <summary>
        /// 序列化为字节数组
        /// </summary>
        /// <param name="configuration"></param>
        /// <returns></returns>
        public static async Task <byte[]> SerializeToBytesAsync(Configuration configuration)
        {
            SerializationConfiguration serializationConfiguration = await configuration.AsSerializationConfigurationAsync();

            //内存实例
            MemoryStream ms = new MemoryStream();
            //创建序列化的实例
            BinaryFormatter formatter = new BinaryFormatter();

            formatter.Serialize(ms, serializationConfiguration);//序列化对象,写入内存流中
            byte[] bytes = ms.GetBuffer();
            ms.Close();
            return(bytes);
        }