DotNetZipZIP工具包

联合创作 · 2023-09-28

DotNetZip 是一个短小易用的用来操作 zip 文件的 .NET 应用,可以在 .NET 的任何一种语言中使用。

代码示例:

   try
{
using (ZipFile zip = new ZipFile("MyZipFile.zip")
{
// add this file into the "images" directory in the zip archive
zip.AddFile("c:\\photos\\personal\\7440-N49th.png", "images");
// add this file into a different directory in the archive
zip.AddFile("c:\\Desktop\\2005_Annual_Report.pdf", "files");
zip.AddFile("ReadMe.txt");
zip.Save();
}
}
catch (System.Exception ex1)
{
System.Console.Error.WriteLine("exception: " + ex1);
}

浏览 4
点赞
评论
收藏
分享

手机扫一扫分享

编辑
举报
评论
图片
表情
推荐
点赞
评论
收藏
分享

手机扫一扫分享

编辑
举报