System.IO.Compression Namespace
.NET Framework 3.5
The System.IO.Compression namespace contains classes that provide basic compression and decompression services for streams.
| Class | Description | |
|---|---|---|
|
DeflateStream | Provides methods and properties for compressing and decompressing streams using the Deflate algorithm. |
|
GZipStream | Provides methods and properties used to compress and decompress streams. |
| Enumeration | Description | |
|---|---|---|
|
CompressionMode | Specifies whether to compress or decompress the underlying stream. |
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
- 8/11/2008
- dazeofcode1
- 3/29/2010
- Zero Serenity
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.
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.
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.
- 10/10/2009
- jaime_olivares
- 10/21/2009
- Thomas Lee