如何使用System.IO.Compression读/写ZIP文件? [英] How to use System.IO.Compression to read/write ZIP files?
问题描述
我知道有库用于处理ZIP文件。此外,您还可以使用Windows内置的功能来处理ZIP文件。
I know there are libraries out there for working with ZIP files. And, you can alternatively use the functionality built into Windows for working ZIP files.
但是,我想知道是否有人已经制定了如何使用内置于System.IO.Compression命名空间内的工具读取/写入ZIP文件?或者,是不是只能使用这个命名空间?
But, I'm wondering if anyone has worked out how to use the tools built into the System.IO.Compression namespace within .NET for reading/writing ZIP files? Or, is it not possible using only this namespace?
UPDATED:我似乎有人评论说System.IO.Packaging命名空间可能是有用的。有人知道如何做吗?
UPDATED: I've seem someone comment that the System.IO.Packaging namespace might be usefull with this also. Does anyone know exactly how to do it?
推荐答案
MSDN有一个完整的示例 http://msdn.microsoft.com/en-us/library/system.io.packaging.zippackage.aspx ZipPackage类。需要.NET 3.5。
MSDN has a complete example http://msdn.microsoft.com/en-us/library/system.io.packaging.zippackage.aspx using the ZipPackage class. Requires .NET 3.5.
这篇关于如何使用System.IO.Compression读/写ZIP文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!