tags:

views:

62

answers:

1

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

+2  A: 

With sharpziplib:

ZipInputStream zip = new ZipInputStream(File.OpenRead(path));
ZipEntry item;
while ((item = zip.GetNextEntry()) != null)
{
    Console.WriteLine(item.Name);
}
Marc Gravell
is it possible without sharpziplib.
Niraj Choubey
@Niraj Choubey: yes, with some other ZIP library (like http://dotnetzip.codeplex.com/) ..... or you have to re-create the whole ZIP code yourself just to peek inside the ZIP file....
marc_s
maybe the `System.IO` will support ZIP archives natively in a future version of the .NET framework - see http://blogs.msdn.com/b/bclteam/archive/2010/06/28/working-with-zip-files-in-net.aspx
marc_s