Compress/Extract zip files with C#
using System; using System.IO; using System.IO.Compression; namespace ConsoleApplication { class Program { static void Main(string[] args) { string startPath = @"c:\example\start"; string zipPath = @"c:\example\result.zip"; string extractPath = @"c:\example\extract"; ZipFile.CreateFromDirectory(startPath, zipPath, CompressionLevel.Fastest, true); ZipFile.ExtractToDirectory(zipPath, extractPath); } } }
![](https://i0.wp.com/samtech365.com/wp-content/uploads/2015/01/visual-studio-2013-logo1.png?fit=469%2C469&ssl=1)
using System; using System.IO; using System.IO.Compression; namespace ConsoleApplication { class Program { static void Main(string[] args) { string startPath = @"c:\example\start"; string zipPath = @"c:\example\result.zip"; string extractPath = @"c:\example\extract"; ZipFile.CreateFromDirectory(startPath, zipPath, CompressionLevel.Fastest, true); ZipFile.ExtractToDirectory(zipPath, extractPath); } } }