How to read data from a zip file without having to unzip the entire file

The Solution to How to read data from a zip file without having to unzip the entire file is


With .Net Framework 4.5 (using ZipArchive):

using (ZipArchive zip = ZipFile.Open(zipfile, ZipArchiveMode.Read))
    foreach (ZipArchiveEntry entry in zip.Entries)
        if(entry.Name == "myfile")
            entry.ExtractToFile("myfile");

Find "myfile" in zipfile and extract it.

~ Answered on 2013-02-07 14:45:38


Most Viewed Questions: