Suppose I have a zip file containing 10 text files. Easily iterate over these text files using:
using (ZipArchive archive = ZipFile.OpenRead(zipIn)) { foreach (ZipArchiveEntry entry in archive.Entries) { Console.writeLine(entry) } }
However, suppose the text files are in a subdirectory:
zip/subdirectory/file1.txt
In this case, the above code only displays the subdirectory folder ("subdirectory"), unlike all text files in this folder.
Is there an easy way to iterate over files in a subdirectory?
source share