Hi somebody have an example or an idea to how to make ZIP files from a
folder?
Thanks a lot
http://dotnetzip.codeplex.com/
using (ZipFile zip = new ZipFile())
{
// add this map file into the "images" directory in the zip
archive
zip.AddFile("c:\\images\\personal\\7440-N49th.png", "images");
// add the report into a different directory in the archive
zip.AddFile("c:\\Reports\\2008-Regional-Sales-Report.pdf",
"files");
zip.AddFile("ReadMe.txt");
zip.Save("MyZipFile.zip");
}
private void MyExtract()
{
string zipToUnpack = "C1P3SML.zip";
string unpackDirectory = "Extracted Files";
using (ZipFile zip1 = ZipFile.Read(zipToUnpack))
{
// here, we extract every entry, but we could extract
conditionally
// based on entry name, size, date, checkbox status, etc.
foreach (ZipEntry e in zip1)
{
e.Extract(unpackDirectory,
ExtractExistingFileAction.OverwriteSilently);
}
}
}