I have zip file and I want to know which library can handle it? Is there built-in method in the.netframework can unzip zip file?
5 Answers
SharpZipLib is a good choice to use with ZIP files in .NET.
See https://github.com/icsharpcode/SharpZipLib or http://icsharpcode.github.io/SharpZipLib/ for more information.

- 537
- 6
- 14

- 29,160
- 8
- 71
- 111
-
I've used this in a few projects and had no problems. Simple and straightfoward. As an aside, it's GPL I think. – kmarks2 Nov 12 '10 at 16:12
-
+1 Works perfectly! Here the link to the simplest example http://wiki.sharpdevelop.net/SharpZipLib_FastZip.ashx – kiewic Jul 02 '11 at 16:31
You can use the System.IO.Compression.DeflateStream class to unzip your file. There's an example there, too.

- 450
- 2
- 12
-
-1 decompressing a stream is not the same as unpacking a zip archive. From the documentation you linked: *"This class does not inherently provide functionality for adding files to or extracting files from .zip archives."* – Wim Coenen Nov 12 '10 at 15:22
-
-1 ZIP is a collection of files, like .tar.gz in unix is, not just a stream like a .gz. – Pieter van Ginkel Nov 12 '10 at 16:17
Use either GZipStream
or DeflateStream
in System.IO.Compression
.
http://msdn.microsoft.com/en-us/library/system.io.compression.deflatestream.aspx
http://msdn.microsoft.com/en-us/library/system.io.compression.gzipstream.aspx
GZipStream
is similar to DeflateStream
, but contains a few extra bits to make it friendly with applications like WinZip.

- 6,099
- 4
- 26
- 41
-
Can those library handle the zip file which contains multiple files and folders? – user496949 Nov 13 '10 at 01:47
Have a look at DotNetZip, created by Cheeso. See also this other answer.

- 1
- 1

- 66,094
- 13
- 157
- 251
Take a look at this: Free compression library for C# which supports 7zip (LZMA)

- 1
- 1

- 33,390
- 4
- 36
- 40