【问题标题】:content inside zip filezip文件内的内容
【发布时间】:2011-03-11 09:15:52
【问题描述】:

如何在不使用 c# 解压的情况下找到 zip 文件中的文件列表。

【问题讨论】:

标签: c# .net zip


【解决方案1】:

sharpziplib:

ZipInputStream zip = new ZipInputStream(File.OpenRead(path));
ZipEntry item;
while ((item = zip.GetNextEntry()) != null)
{
    Console.WriteLine(item.Name);
}

【讨论】:

【解决方案2】:

sharpziplib 有一个简单的方法:

        using (var zipFile = new ZipFile(@"C:\Test.zip"))
        {
            foreach (ZipEntry entry in zipFile)
            {
                Console.WriteLine(entry.Name);
            }
        }

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2018-05-16
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-01-02
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多