Make ZIP files from ASP.NET with VB

  • Thread starter Thread starter Marcos G.
  • Start date Start date
M

Marcos G.

Hi somebody have an example or an idea to how to make ZIP files from a
folder?

Thanks a lot
 
Have a look on codeplex (http://www.codeplex.com) - there are several
zip libraries there.

Can't vouch for them as I have not had the need to use them.

Hope this helps,
Mark


Hi somebody have an example or an idea to how to make ZIP files from a
folder?

Thanks a lot
--
|\ _,,,---,,_ A picture used to be worth a
ZZZzzz /,`.-'`' -. ;-;;, thousand words - then along
|,4- ) )-,_. ,\ ( `'-' came television!
'---''(_/--' `-'\_)

Mark Stevens (mark at thepcsite fullstop co fullstop uk)

This message is provided "as is".
 
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);
}
}
}
 
Back
Top