Zipping Folders in C# [duplicate]
Can any one have the idea h开发者_如何学运维ow to zip folders (including sub files and folders like winrar doing) using C#...?
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"); }
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.)
精彩评论