如何基本上用sevenzipsharp提取文件 [英] how to basically extract file with sevenzipsharp
本文介绍了如何基本上用sevenzipsharp提取文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我将使用sevenzipsharp从iso文件中将文件提取到usb.为此,我从vs nuget软件包管理器中下载sevenzipsharp,并对此代码进行了编码(实际上我不能:)).我没有任何错误,但它没有用.我在哪里犯错?请写详细信息.
I will extract files to usb from iso file with sevenzipsharp. For this, I download sevenzipsharp from vs nuget package manager and I coded (actually I couldn't :) ) this code . I dont take any error but It isnt working. Where do I make mistakes? Please write details.
if (IntPtr.Size == 8) //x64
{
SevenZip.SevenZipExtractor.SetLibraryPath(@"C:\Program Files\7-Zip\7z.dll");
}
else //x86
{
SevenZip.SevenZipCompressor.SetLibraryPath(@"C:\Program Files (x86)\7-Zip\7z.dll");
}
using (var file = new SevenZipExtractor(sourcePath))
{
file.ExtractArchive(outputPath);
}
提前谢谢
推荐答案
对于x86,您正在执行SevenZip.SevenZipCompressor.SetLibraryPath
,而您可能打算执行SevenZip.SevenZipExtractor.SetLibraryPath
.
For x86 you are doing SevenZip.SevenZipCompressor.SetLibraryPath
where you probably meant to do SevenZip.SevenZipExtractor.SetLibraryPath
.
这篇关于如何基本上用sevenzipsharp提取文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文