[By Peter Bromberg]
The .NET Framework has GzipStream and DeflateStream classes for compression tasks, but they do not support the standard ZIP file / folder FileEntry mechanism to zip a folder with all its files and subfolders.
Fortunately, the ICSharpCode SharpZipLib project does support this, as well as passwords for zip files and compression level.
Here is a utility class I wrote that handles zipping or unzipping a folder with all its subfolders and contained files, using SharpZipLib:
You can click Here to download the SharpZipLib!
1
using System;
2
using System.Collections;
3
using System.IO;
4
using ICSharpCode.SharpZipLib.Zip;
5
6
namespace FolderZipper
7
}