C# 用SevenZipSharp提取C

C# 用SevenZipSharp提取C,c#,.net,archive,7zip,sevenzipsharp,C#,.net,Archive,7zip,Sevenzipsharp,我试图从存档中提取文件,但出现异常“System.ArgumentOutOfRangeException”。 我认为这可能是字符串中的问题,其中包含文件名 var cpioExtractor = new SevenZipExtractor(archiveName); 我尝试手动输入文件的路径,但它不会改变任何东西。 问题出在哪里 堆栈跟踪 在System.String.InternalSubstring中,使用CHECKSINT32 startIndex、Int32 length、布尔值FAL

我试图从存档中提取文件,但出现异常“System.ArgumentOutOfRangeException”。 我认为这可能是字符串中的问题,其中包含文件名

var cpioExtractor = new SevenZipExtractor(archiveName);
我尝试手动输入文件的路径,但它不会改变任何东西。 问题出在哪里

堆栈跟踪

在System.String.InternalSubstring中,使用CHECKSINT32 startIndex、Int32 length、布尔值FALWAY 在System.String.SubstringInt32 startIndex中 在SevenZip.Formats.FormatByFileNameString文件名中,布尔值报告错误 在SevenZip.FileChecker.CheckSignatureString文件名中,Int32和offset、Boolean和i可执行 在SevenZip.SevenZipExtractor.InitString archiveFullName中 在SevenZip.SevenZipExtractor..ctorString archiveFullName中


你得到的异常的堆栈跟踪是什么?还有,这个异常的完整消息是什么,它的ParamName属性值是什么?archiveName等于@E:\GitHub\Repack-Unpack\u MTK-Img\Repack-Unpack\u MTK-Img\bin\Debug\temp\ram\u disk你的7z归档文件名是没有任何扩展名的ram\u disk?这就是问题所在。如果我看看水流!在SevenZipSharp中负责归档文件名检查的源代码文件,然后很明显SevenZipSharp会抱怨缺少或无效的归档文件扩展名。使用构造函数重载SevenZipExtractorstring archiveFullName,InArchiveFormat格式,并在其中指定正确的存档格式。我希望这有帮助。我从未使用过SevenZipSharp,只是简单地浏览了一下它的源代码。。。