using (ZipFile zip = new ZipFile())
{
foreach(string file in Directory.GetFiles(folder))
{
zip.AddFile(file, Path.GetFileName(file));
}
zip.Save("test.zip"));
}
Each time I add a file, it's creating a new subfolder for it.
So I want to end up with:
test.zip
- myDoc.doc
- myPdf.pdf
but I'm ending up with:
test.zip
- myDoc.doc
- myDoc.doc
- myPdf.pdf
- myPdf.pdf
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…