如何使用System.IO.Com pression读/写ZIP文件?如何使用、文件、System、Com

2023-09-02 10:35:42 作者:两眼一睁开始竞争

我知道有库在那里与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.Com pression命名空间中的工具,在.NET读/写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?

更新:我已经好像有人评论说,在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.