Extract a ZipFile
How can Extract a ZipFile in 开发者_运维知识库C#? (ZipFile is include file and Directory)
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.
As @Arnis L mentioned, will have problem unZipping .Zip files. Cannot use GZipStream to open a zip file, try
DotNetZip or CGZipLibrary.dll
精彩评论