用于分割卷 zip 文件的 .Net 库?

发布于 2024-11-19 15:16:50 字数 294 浏览 1 评论 0原文

我需要使用 .Net 创建跨区(多卷)zip 文件,但我一直无法找到使我能够执行此操作的库。

Spanned zip 是一种 zip 压缩文件,分为多个文件,这些文件通常具有 .z00、.z01 等扩展名。

该库必须是开源的或免费的,因为我要将它用于开源项目。

(它与这个问题重复,但那里没有答案,我反正我不会专门针对 ASP)

I need to create spanned (multi-volume) zip files using .Net, but I have been unable to find a library that enables me to do it.

Spanned zip is a zip compressed file that is split among a number of files, which usually have extensions like .z00, .z01, and so on.

The library would have to be open-source or free, because I'm gonna use it for a open source project.

(it's a duplicate to this question, but there are no answers there and I'm not going for ASP specific anyway)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

素手挽清风 2024-11-26 15:16:50

DotNetZip 示例:

int segmentsCreated ;
using (ZipFile zip = new ZipFile())
{
  zip.UseUnicode= true;  // utf-8
  zip.AddDirectory(@"MyDocuments\ProjectX");
  zip.Comment = "This zip was created at " + System.DateTime.Now.ToString("G") ;
  zip.MaxOutputSegmentSize = 100*1024 ; // 100k segments
  zip.Save("MyFiles.zip");

  segmentsCreated = zip.NumberOfSegmentsForMostRecentSave ;
}

如果 segmentsCreated 返回为 5,则您拥有以下文件,每个文件的大小不超过 100kb。

  • MyFiles.zip
  • MyFiles.z01
  • MyFiles.z02
  • MyFiles.z03
  • MyFiles.z04

编辑注意: DotNetZip 曾经住在 Codeplex。 Codeplex 已关闭。旧存档仍然[可在 Codeplex 上找到][1]。代码似乎已迁移到 Github:


DotNetZip example:

int segmentsCreated ;
using (ZipFile zip = new ZipFile())
{
  zip.UseUnicode= true;  // utf-8
  zip.AddDirectory(@"MyDocuments\ProjectX");
  zip.Comment = "This zip was created at " + System.DateTime.Now.ToString("G") ;
  zip.MaxOutputSegmentSize = 100*1024 ; // 100k segments
  zip.Save("MyFiles.zip");

  segmentsCreated = zip.NumberOfSegmentsForMostRecentSave ;
}

if segmentsCreated comes back as 5, then you have the following files, each not more than 100kb in size.

  • MyFiles.zip
  • MyFiles.z01
  • MyFiles.z02
  • MyFiles.z03
  • MyFiles.z04

Edited To Note: DotNetZip used to live at Codeplex. Codeplex has been shut down. The old archive is still [available at Codeplex][1]. It looks like the code has migrated to Github:


流星番茄 2024-11-26 15:16:50

DotNetZip 允许您执行此操作。从他们的文档中:

该库支持zip密码、Unicode、ZIP64、流输入和输出,
AES加密,多种压缩级别,自解压存档,
跨越档案等等。

DotNetZip allows you to do this. From their documentation:

The library supports zip passwords, Unicode, ZIP64, stream input and output,
AES encryption, multiple compression levels, self-extracting archives,
spanned archives, and more.

自找没趣 2024-11-26 15:16:50

查看 SevenZipSharp 库。它支持多卷存档。

Take a look at the SevenZipSharp library. It supports multivolumes archives.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文