Ejemplo n.º 1
0
        /// <summary>
        /// 获取配置文件Json字符串
        /// </summary>
        /// <param name="FilePath"></param>
        /// <returns></returns>
        private string UnZipStringAndOpen(string FilePath)
        {
            FileStream _FileStream = new FileStream(FilePath, FileMode.Open);

            try
            {
                byte[] temp = new byte[2048];
                int    num  = _FileStream.Read(temp, 0, temp.Length);
                //byte[] tempUnZip = DataEncoder.Decompress(temp, 0, num);

                _FileStream.Close();
                _FileStream = null;

                return(DataEncoder.GZipDecompressString(System.Text.Encoding.UTF8.GetString(temp, 0, num)));
            }
            catch (Exception ex)
            {
                _FileStream.Close();
                _FileStream = null;
                throw ex;
            }
        }