1. 程式人生 > >字串壓縮和解壓

字串壓縮和解壓

{
            
byte[] data = Convert.FromBase64String(zipedstr);
            MemoryStream mStream
=new MemoryStream(data);
            GZipStream gStream 
=new GZipStream(mStream, CompressionMode.Decompress);
            StreamReader streamR 
=new StreamReader(gStream);
            
string outs = streamR.ReadToEnd();
            mStream.Close();
            gStream.Close();
            streamR.Close();
            
return outs;
        }