2016-12-11 65 views
0

我必須提取一個7z文件。UWP解壓縮7Z文件

如果我使用:

Dim archive = Await localFolder.GetFileAsync("5.7z") 
IO.Compression.ZipFile.ExtractToDirectory(archive.Path, localFolder.Path) 

我收到一個錯誤:

An exception of type 'System.IO.InvalidDataException' occurred in System.IO.Compression.ZipFile.dll but was not handled in user code Additional information: End of Central Directory record could not be found.

(我知道......它只是對.zip文件,但我想我會嘗試)

我可以在UWP中解壓7z文件嗎?

我必須安裝一個特定的.dll嗎?如果是這樣,哪一個?

我試圖安裝SevenZipSharpSevenZipExtractorSevenZipSharp.Net45,但在每種情況下安裝都出錯了。

任何人都可以幫助我嗎?

+3

您可能可以使用LZMA SDK,但您必須重新編譯它才能自己鎖定Windows Store:http://www.7-zip.org/sdk.html – Sunius

+0

您看到的錯誤消息是什麼? 「錯誤」對於故障排除毫無用處。 – Chris

+0

這是我使用IO.Compression.ZipFile.ExtractToDirectory(archive.Path,localFolder.Path)時發生的錯誤 System.IO.Compression.ZipFile.dll發生System.IO.Compression.ZipFile.dll類型的「System.IO.InvalidDataException」異常,但是未在用戶代碼中處理 其他信息:無法找到中央目錄記錄的結尾。 –

回答

0

我已經使用SharpCompress 解決了nuget包中的p3-sharpcompress問題。