![](/img/trans.png)
[英]DotNetZip | C# Getting the extracted folder, not the .zip file that has just been unzipped?
[英]C# DotNetZip Error: The final hash has not been computed. at Ionic.Zip.WinZipAesCipherStream.get_FinalAuthentication()
大多數情況下,這段代碼都可以工作,但是,大約有 1/3 的時間,它通過了大約 80% 的時間並失敗了。 解壓縮 x 射線圖像文件時解壓縮失敗。 (它們是沒有文件擴展名的編號文件。)它似乎在大多數時間都能處理它們,但是,每隔一段時間就會有一個無法解壓縮的 X 射線。 當它在文件上失敗時,它會給它一個帶有隨機擴展名的隨機文件名。 它似乎在解壓縮時遇到了它不理解的字符組合。
它特別發生在 aes 加密的 zip 文件中。 如果他們發送沒有 aes 加密壓縮的相同文件,那么程序會很好地解壓縮它們。
當我使用 7zip 應用程序手動解壓縮同一個 zip 文件時,我輸入了相同的密碼並且它工作得很好。
前任。 文件應該是:00043 ==> 解壓失敗產生:1hzcqoee.nss
尚未計算最終散列。
在 Ionic.Zip.WinZipAesCipherStream.get_FinalAuthentication() 在 Ionic.Zip.ZipEntry.VerifyCrcAfterExtract(Int32calculatedCrc32, EncryptionAlgorithm encryptionAlgorithm, Int32 expectedCrc32, Stream archiveStream, Int64 uncompressedSize) at Ionic.Zip. encryptionAlgorithm, Int32 expectedCrc32) at Ionic.Zip.ZipEntry.InternalExtractToBaseDir(String baseDir, String password, ZipContainer zipContainer, ZipEntrySource zipEntrySource, String fileName) at Ionic.Zip.ZipFile._InternalExtractAll(String path, Boolean overrideExtractExistingNewPropertySystemsZip4) at Ionic.Zip.ZipEntry.InternalExtractToBaseDir(String baseDir, String password, ZipContainer zipContainer, ZipEntrySource zipEntrySource, String fileName) (字符串 zipToUnpack,字符串 unpackDirectory)
using Ionic.Zip;
public bool ExtractZip(string zipToUnpack, string unpackDirectory)
{
using (ZipFile zip1 = ZipFile.Read(zipToUnpack))
{
foreach (ZipEntry z in zip1)
{
if (z.FileName.Contains(".mdf"))
{
foundMDF = true;
isEncrypted = z.UsesEncryption;
}
}
if(isEncrypted)
zip1.Password = zipPass;
zip1.ExtractAll(unpackDirectory, ExtractExistingFileAction.DoNotOverwrite);
ExtractSuccess = true;
}
return ExtractSuccess;
}
我什至嘗試使用以下行添加第二次嘗試,它產生相同的結果。
zip1.ParallelDeflateThreshold = -1;
有沒有人處理過這個錯誤? 請幫我解決這個哈希錯誤! 謝謝!
如果它發生在其他人身上,這是一個錯誤並且它得到了修復https://github.com/haf/DotNetZip.Semverd/issues/201所以,更新你的 nuget。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.