且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何解压缩文件夹或文件

更新时间:2022-01-05 22:46:33

Clickety [ ^ ]




您可以使用GZipStream类:
http://msdn.microsoft.com/en-us/library/system. io.compression.gzipstream.aspx [ ^ ]

但是,正如我记得的那样,.NET的功能也要求文件/文件夹也使用GZipStream压缩.它无法处理解压缩普通zip文件的情况.
要解压缩普通档案,您应该使用外部组件,例如SharpZipLib库:
http://www.icsharpcode.net/OpenSource/SharpZipLib/ [
Hi,

you can use the GZipStream class:
http://msdn.microsoft.com/en-us/library/system.io.compression.gzipstream.aspx[^]

but as I remember this feature of .NET requires that the files/folders were zipped with GZipStream too. It can''t handle unzipping normal zip files.
To unzip normal archives, you should use an external component such as the SharpZipLib library:
http://www.icsharpcode.net/OpenSource/SharpZipLib/[^]