创建,读取,和更新zip文件的.NET开源库:DotnetZip

jopen 10年前

DotnetZip是一个开源类库,支持.NET的任何语言,可很方便的创建,读取,和更新zip文件。而且还可以使用在.NETCompact Framework中。
以下是创建一个zip文件的C#代码。

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

项目主页:http://www.open-open.com/lib/view/home/1381633833520