zip文件中的内容
如何在没有在c#中解压缩的情况下查找zip文件中的文件列表。
使用sharpziplib :
ZipInputStream zip = new ZipInputStream(File.OpenRead(path)); ZipEntry item; while ((item = zip.GetNextEntry()) != null) { Console.WriteLine(item.Name); }
使用sharpziplib有一种简单的方法:
using (var zipFile = new ZipFile(@"C:\Test.zip")) { foreach (ZipEntry entry in zipFile) { Console.WriteLine(entry.Name); } }