2 out of 5 rated this helpful - Rate this topic

System.IO.Compression Namespace

The System.IO.Compression namespace contains classes that provide basic compression and decompression services for streams.

  Class Description
Public class DeflateStream Provides methods and properties for compressing and decompressing streams using the Deflate algorithm.
Public class GZipStream Provides methods and properties used to compress and decompress streams.
  Enumeration Description
Public enumeration CompressionMode Specifies whether to compress or decompress the underlying stream.
Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ
See Also: System.IO.Packaging

For working with Archive files see System.IO.Packaging

http://msdn.microsoft.com/en-us/library/system.io.packaging.aspx

If you want to manipulate ZIP files...
The classes in this namespace won't suffice. You can do some things with System.IO.Packaging, but it is not intuitive or easy. There's a nice, free third party library though, that will let you create, read, extract, and update ZIP files. DotNetZip.
http://DotNetZip.codeplex.com

It does regular ZIP files very easily. You can create or read ZIP files in WinForms apps, WPF apps, ASP.NET apps, mobile device apps, and more. It works with VB or C# or any .NET language. It's fully managed code. A single DLL. It supports Unicode, password protection, AES, streaming, ZIP64, file and archive comments, self-extracting archives, split or spanned archives, and more stuff. You can add or extract files by name. Or by wildcard. You can add or extract files based on file attributes, file size, or even file time. It has an easy-to-use eventing model. Full documentation in chm format. And the compression is fast, and very good.

DotNetZip also includes a useful GUI tool that you can use to create or read zip files. It's a good replacement for WinZip - and it's all open-source, based on the DotNetZip library.

Check it out.
ZipStorer: A Pure C# Class to Store Files in Zip
Notice DeflateStream cannot read/write a .zip file directly (neither GZipStream).

ZipStorer library provides support for Zip files for the .NET and .NET Compact Frameworks in a simple and monolithic class: http://zipstorer.codeplex.com

Also non-compressed storage support for Silverlight.