I'm creating my zip archive using SharpCompress library. I successfully create Zip archive but, the library, automaticcally update file's edit date to current datetime. I don't want this behaviour. What I would is: the edit date will be unchanged (i.e.: the edit date of file in the archive is the same of the file before archiviation).
How can avoid this behaviour? This is my code:
private String CreaPacchettoZip(String idProcesso, String pdfBasePath)
{
List<String> listaPdfDiProcesso = FileHelper.EstraiListaPdfDaDirecotry(pdfBasePath);
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;
}