I successfully create my zip archive but, I don't want that editing date of file added in this zip archive is automatically altered. In the worst case I would set editing date to a given date.
How can avoid this behaviour? This is my code:
How can avoid this behaviour? This is my code:
private String CreaPacchettoZip(String idProcesso, String pdfBasePath, String primoPdfPacchetto, String ultimoPdfPacchetto)
{
List<String> listaPdfDiProcesso = FileHelper.EstraiListaPdfDaDirecotry(pdfBasePath, primoPdfPacchetto, ultimoPdfPacchetto);
String zipFile = Path.Combine(pdfBasePath, idProcesso + ".zip");
using (var archive = ZipArchive.Create())
{
foreach (String file in listaPdfDiProcesso)
{
archive.AddEntry(file, new FileInfo(pdfBasePath, file));
}
using (Stream newStream = File.Create(zipFile))
{
archive.SaveTo(newStream, SharpCompress.Common.CompressionType.None);
}
}
return zipFile;
}