The Microsoft .NET Framework {v2.0 v3.0 v3.5} includes base class libraries supporting compression within streams - both the Deflate and Gzip formats are supported. But the System.IO.Compression namespace provides streaming compression only - useful for communicating between cooperating parties but not directly useful for creating compressed archives, like .zip files. The built-in compression library does not know how to format zip archive headers and so on.
To address this, this simple class library augments the System.IO.Compression.DeflateStream class, to provide handling for Zip files. Using this library, you can write .NET applications that read and write zip-format files.
Frequently Asked Questions
How does this Zip Library work?
There's a single DLL, a single assembly, fully managed code, written in C#, that provides support for reading and writing Zip archive files and streams.
What do I need to "do" zip files from within my application?
To use the zip capability in your applications, you need to be using the .NET Framework 2.0 or later, and you need the DotNetZip assembly. You can use the Zip library from any application, whether a console application, a Windows-Forms application, a server-based application like an ASP.NET page, or something else. You can use C#, VB.NET, COBOL.NET, IronPython, IronRuby, F#, or any other .NET language.
How big is the library?
The zip DLL is under 40k in size. There is no other pre-requisite.
Does this library make self-extracting zip files?
No. It makes standard zip files.
Are the zip files this library makes compatible with the Java.util.zip classes in the Java class library?
Yes. This library makes standard zip files.
Can I use Windows Explorer to open the zip files that this library creates?
Yes. This library makes standard zip files.
Does the library support zero-length zip files, zipfile comments, zip entry comments, and zipping up empty directories?
Yes.
If I create a zipfile with this library, can I open it from within a Java application, using the java.util.zip library?
Yes. This library makes standard zip files, so anything that can read and write zip files, on any platform, can work with zipfiles generated from this library.
Does this library support any compression algorithm other than deflate?
No. That is what is provided by the System.IO.Compression.DeflateStream class.
Why would I not just use the Packaging APIs included in the .NET Framework 3.0?
This library is generally simpler for creating zipfiles.
Does the library support reading or writing encrypted or password protected zip files?
No.
Does the library support Unicode filenames and comments?
No. Not yet anyway. I'm interested in taking contributions on that.
Is there documentation for the library?
Yes, there is a CHM file in MSDN helpfile format, generated from the xml comments in the code.
Does the library support zipping to a stream? Or unzipping from a stream?
Yes. As well you can zip to and from filesystem files, as you would expect.
Ok, you can unzip from a stream. But can you zip from a stream?
Yes, that's been added after v1.3.