I would like to be able to include a file with a given order when creating a zip when using DotNet Zip .
Files do not appear in the sequence they added to zip. Now the order looks random.
I would like to have xyz-Header, xyz-Summary files included first, and then the rest of the files.
XYZ-Header.csv
XYZ-Summary.csv
XYZ-Male.csv
XYZ-Female.csv
xyz , and the names of other files are programmatically determined , but header and summary files are always included.
Code snippet
private MemoryStream GetZip() { ZipFile zip = new ZipFile(); List<string, string> files = getFiles(); zip.AddEntry("xyz-Header.csv", getHeader(files )); zip.AddEntry("xyz-Summary", getSummary(files)); foreach (var x in files) { zip.AddEntry("xyz-" + x.Item1 + ".csv", x.Item2); } MemoryStream memoryStream = new MemoryStream(); zip.Save(memoryStream); memoryStream.position = 0; return memoryStream; }
I would appreciate any help with this.
source share