views:

33

answers:

3

I want to create zip file from my mvc.net c# application by using the .net framework classes. Please response to me as soon as possible.

+1  A: 

Use external library like this one or this one. For example with DotNetZip you can make a zip file like this:

 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");
 }
ŁukaszW.pl
+3  A: 

Have you looked into SharpZipLib?

FrustratedWithFormsDesigner
+3  A: 

There isn't much in the way of manipulating zip files included in .net.
One third party library I've is http://dotnetzip.codeplex.com/

I like it a lot more than SharpZipLib -- SharpZipLib isn't really very intuitively layed out at all.

Joshua Evensen