views:

96

answers:

2
+2  Q: 

Extract a ZipFile

How can Extract a ZipFile in C#? (ZipFile is include file and Directory)

+8  A: 

Use a tool for that. Something like SharpZip. As far as I know - .NET does not support ZIP files out of the box.

From here =>

There are 2 problems with this class.
- It does not handle ZIP files.
- It is dysfunctional, can actually inflate data in "compression".
There's something wrong with the logic. It's a known problem but as yet unfixed.

So - if you need to work with ZIP files, gzipstream won't help. Otherwise - it should work fine.

Arnis L.
+1 I tend to see SharpZip used a lot
MPritch
+1 the right answer, first time
Asad Butt
Does any library support RAR files?
Tuoski
@Tuoski http://stackoverflow.com/questions/11737/net-library-to-unzip-zip-and-rar-files
Arnis L.
+4  A: 

As @Arnis L mentioned, will have problem unZipping .Zip files. Cannot use GZipStream to open a zip file, try

DotNetZip or CGZipLibrary.dll

Asad Butt
It works for regular zips?
Arnis L.
That's better. ;)
Arnis L.
Can you remove the bulk of your answer that does not apply to the question please?
MPritch
it's gone. thanks any way
Asad Butt