Yes, you can list zip file files using SharpZipLib. You can also select files from a zip file and copy these files to a directory on your disk.
Here is a small example:
using (var fs = new FileStream(@"c:\temp\test.zip", FileMode.Open, FileAccess.Read)) { using (var zf = new ZipFile(fs)) { foreach (ZipEntry ze in zf) { if (ze.IsDirectory) continue; Console.Out.WriteLine(ze.Name); using (Stream s = zf.GetInputStream(ze)) { byte[] buf = new byte[4096];
In the above example, I use a MemoryStream to store a ZipEntry in memory (for further analysis). You can also save ZipEntry (if it meets certain criteria) to disk.
Hope this helps.
source share