Make ZIP files from ASP.NET with VB

M

Marcos G.

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

Thanks a lot
 
M

Mark Stevens

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".
 
C

Cubaman

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);
}
}
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top