I want to compress an entire directory which can have any number of subdirectories into a single ZIP file.
I am able to compress a single file into a zip file progra
Using DotNetZip, there's an AddDirectory() method on the ZipFile class that does what you want:
using (var zip = new Ionic.Zip.ZipFile()) { zip.AddDirectory("DirectoryOnDisk", "rootInZipFile"); zip.Save("MyFile.zip"); }
This example, and many others, are available on codeplex.