Can any one have the idea how to zip folders (including sub files and folders like winrar doing) using C#...?
Asked
Active
Viewed 424 times
0

Ramesh.kbvr
- 763
- 6
- 15
- 31
-
Duplicate: [Zip folder in C#](http://stackoverflow.com/questions/905654/zip-folder-in-c) – Devendra D. Chavan Mar 09 '11 at 13:49
2 Answers
2
This is a pretty nice general .NET utility for handling zip-related actions and files. http://dotnetzip.codeplex.com/
An example of usage, pasted from the website link I just provided:
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"); }

invalidsyntax
- 640
- 1
- 5
- 14
1
After a quick google I found this: SharpZipLib (From the site: #ziplib (SharpZipLib, formerly NZipLib) is a Zip, GZip, Tar and BZip2 library written entirely in C# for the .NET platform.)

SynerCoder
- 12,493
- 4
- 47
- 78