簡體   English   中英

在 C# 中提取 zip 文件時,拆分和跨越不支持錯誤

[英]split and spanned not support error while zip file extraction in c#

在 C# 中使用 ziparchival 類進行 Zip 文件提取。 它適用於少數文件,但文件大小超過 1 GB 時會拋出“不支持拆分或跨區存檔”。 我不明白這是什么意思。 如何解決?

DotNetZip允許您執行此操作。 從他們的文檔:

該庫支持 zip 密碼、Unicode、ZIP64、流輸入和輸出、AES 加密、多個壓縮級別、自解壓檔案、跨度檔案等。

使用 Dotnetzip 庫,您可以壓縮甚至超過 4 GB。 使用文件流和字節數組也更容易使用。

using (ZipFile zip = new ZipFile()) {
    zip.CompressionLevel = CompressionLevel.BestCompression;
    zip.UseZip64WhenSaving = Zip64Option.Always;
    zip.BufferSize = 65536*8; //buffer size

    foreach (var file in filenames) {
        zip.AddFile(file);
    }
    zip.Save(outpath);
}

當您嘗試提取在復制過程中損壞的 Zip 文件時,我已經看到此錯誤。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM