Questions dealing with the DotNetZip open-source zip library for .NET
DotNetZip is an open source zip library. DotNetZip works on PCs with the full .NET Framework, and also runs on mobile devices that use the .NET Compact Framework. Silverlight is also supported.
Below is an example of using the library with C#:
using (ZipFile zip = new ZipFile())
{
// add this map file into the "images" directory in the zip archive
zip.AddFile("c:\\images\\personal\\7440-N49th.png", "images");
// add the report into a different directory in the archive
zip.AddFile("c:\\Reports\\2008-Regional-Sales-Report.pdf", "files");
zip.AddFile("ReadMe.txt");
zip.Save("MyZipFile.zip");
}
Note: Just for reference the project builds into Ionic.Zip.dll
Installation
DotNetZip can most easily be installed through its NuGet package.
Install-Package DotNetZip