我想使用C#提取ISO,我找到了一個Winzip庫,DotNetZip,並使用它,但是當我運行該項目時它說它無法提取ISO。使用WinZip/WinRar提取ISO文件夾
string activeDir = copyTo = this.folderBD.SelectedPath;;
folderName = toExtract.Remove(toExtract.Length - 4, 4);
Path.Combine(activeDir, Path.GetFileNameWithoutExtension(folderName));
string zipToUnpack = toExtract;
string unpackDirectory = folderName;
using (ZipFile zip1 = ZipFile.Read(zipToUnpack))
{
// here, we extract every entry, but we could extract conditionally
// based on entry name, size, date, checkbox status, etc.
foreach (ZipEntry file in zip1)
{
file.Extract(unpackDirectory, ExtractExistingFileAction.OverwriteSilently);
}
}
這就是我正在使用的代碼。 copyTo
和folderName
是從程序中的其他方法發送的。
任何讓我在ISO上使用Winzip或Winrar的庫都會有很大幫助,但到目前爲止,我的搜索沒有任何結果。
在此先感謝
編輯: 你能只提取.rar程序或用winrar用C#.zip或可以通過文件被提取爲arguement又如何?我試過
ProcessStartInfo startInfo = new ProcessStartInfo("winrar.exe"); Process.Start("winrar.exe",@"C:\file\to\be\extracted");
的ISO的位置,但它返回一個例外,沒有什麼解壓那裏。
我一直能夠提取ISO,只要提取它就可以創建正確的方法。什麼是不工作,你確定ISO已經產生了正確的方式? –
ISO確定生成正確。我嘗試使用winzip,因爲我找到了它的庫,所以想通了它是唯一的方法,但它不會讓我提取一個iso,只有一個zip – ELSheepO
你問了同樣的問題[Here](http://stackoverflow.com/ q/10579964/1118933)也!和[答案是這樣的!](http://stackoverflow.com/a/10580489/1118933) – Writwick