Skip to main content

Posts

Showing posts with the label Compress

Compress and decompress data in c#

In this post,I will show you how to compress and decompress data in   c# using GzipStream class.Below is the code for the same using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Text; using System.IO.Compression; namespace CompressDecompress {     class Program     {         const string CompressFilePath = @"C:\temp\data.zip";         const string Filename = @"C:\temp\data.txt";         private const string DeCompressFilePath = @"C:\temp\data1.txt";         static void Main(string[] args)         {             Compress(Filename);             Decompress(CompressFilePath);   ...