简体   繁体   English

压缩文件中的内容

[英]Content inside zip file

how to use zippackage class to know about the content in .zip file? 如何使用zippackage类了解.zip文件中的内容? for ex to know the type of file inside this zip file. 供ex知道此zip文件中文件的类型。

Once you open the .zip file, you can use the GetParts method to get a collection of all the files inside the .zip. 打开.zip文件后,可以使用GetParts方法获取.zip中所有文件的集合。 See the PackagePart class. 请参见PackagePart类。

http://sharpdevelop.net/OpenSource/SharpZipLib/ is a good zip library for CSharp. http://sharpdevelop.net/OpenSource/SharpZipLib/是CSharp的一个很好的zip库。

Although, you might just want to use something like the DeflateStream class (http://msdn.microsoft.com/en-us/library/system.io.compression.deflatestream.aspx) which provides a compressed stream and doesn't require dealing with the complexities of an archive that handles multiple files. 虽然,您可能只想使用DeflateStream类(http://msdn.microsoft.com/zh-cn/library/system.io.compression.deflatestream.aspx)之类的东西,它提供了压缩流,并且不需要处理处理多个文件的存档的复杂性。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM