如何从 zip 文件中读取文件属性 ..?

How to Read file properties from a zip file ..?

我有一个 zip 文件,我想从这个 zip 文件中读取文件属性,如果文件符合我的信息就像我想要 .doc 文件并且在 zip 中文件是 .doc 然后复制它。如果有一个包含文件夹的 zip 文件,并且该文件夹包含 Zip 文件,并且在该 zip 文件中有另一个文件夹,然后有所需的文件,那么我如何才能获得所需的文件并保存该文件的完整路径。? 我想在 c# 中执行此操作。

使用 DotNetZip,您可以像阅读 zip 文件中的文件一样简单:

string zipPath = @"c:\example\MyFile.zip";
using (zip archive = ZipFile.OpenRead(zipPath))
{
      foreach (ZipArchiveEntry entry in archive.Entries)
      {
          System.Console.WriteLine(entry.);
      }
 }