content inside zip file

前端 未结 2 2004
感动是毒
感动是毒 2020-12-10 08:08

how to find list of files inside zip file without unzipping it in c#.

相关标签:
2条回答
  • 2020-12-10 08:42

    With sharpziplib:

    ZipInputStream zip = new ZipInputStream(File.OpenRead(path));
    ZipEntry item;
    while ((item = zip.GetNextEntry()) != null)
    {
        Console.WriteLine(item.Name);
    }
    
    0 讨论(0)
  • 2020-12-10 08:44

    There is a simple way to do this with sharpziplib :

            using (var zipFile = new ZipFile(@"C:\Test.zip"))
            {
                foreach (ZipEntry entry in zipFile)
                {
                    Console.WriteLine(entry.Name);
                }
            }
    
    0 讨论(0)
提交回复
热议问题