A lot of solutions exists that show how to zip files in .NET, for example some of them using SharpZipLib, GZipStream, Windows Shell API or the ZipLibrary class. However one lesser known solution which I have found to be very useful is the DotNetZip library
As given on the site - “DotNetZip is an easy-to-use FREE class library and toolset for manipulating zip files or folders. Zip and Unzip is easy: with DotNetZip, .NET applications written in VB, C# - any .NET language - can easily create, read, extract, or update zip files. It works on Mono or MS .NET”
You can download DotNetZip Library over here.
Here’s a sample that shows how to use this library to zip all files in a folder
static void Main(string args)
using (ZipFile zip = new ZipFile())
catch (ZipException ex)
Imports SystemDepending on the size of the files in a folder, it may take some time for the zip operation to complete.
Shared Sub Main(ByVal args() As String)
Using zip As New ZipFile()
Catch ex As ZipException
Will you give this article a +1 ? Thanks in advance