SevenZSharp 使用密码解码
我使用 此处 的 SevenZSharp
来解码我使用的文件:
CompressionEngine.Current.Decoder.DecodeIntoDirectory(@"D:\target\host_update.7z", @"D:\target");
但我没有信息如何使用密码解码.7z 文件!?请帮我。谢谢
I work with SevenZSharp from here
for Decode file I use:
CompressionEngine.Current.Decoder.DecodeIntoDirectory(@"D:\target\host_update.7z", @"D:\target");
But I don't have information how to decode .7z file with password!? Please, help me. Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
要使用支持密码和多种格式的“SevenZipSharp”...
将 SevenZipSharp.dll 导入 .Net 项目引用...
将“7zx64.dll”和“7z.dll”放入目录...
然后使用此代码用于检查通过并提取是否正确。
代码
To use "SevenZipSharp" which DOES support passwords and a wide range of formats...
Import SevenZipSharp.dll into .Net project references...
Place "7zx64.dll" and "7z.dll" into the directory...
Then use this code to check the pass and extract if correct..
code
从SevenZSharp的源代码来看,它不支持密码保护的文件。
这里还有一些可能对您在 Codeplex 中有所帮助的内容。它似乎有一个名为
ICryptoGetTextPassword
的界面,如果 7z 受密码保护,您可能可以使用该界面。编辑
进一步查看SevenZipSharp,它似乎应该支持根据其项目页面进行密码保护的存档( http://sevenzipsharp.codeplex.com/ ):
您需要从 Codeplex 下载最新的代码并自行构建,在其中您可以将有一个名为
SevenZipExtractor
的类,其中具有以下构造函数:注意这与 Seven7Sharp 不同,这是 SevenZipSharp,但它适用于
7z
。By the look of the source code of SevenZSharp, it does not support password protected files.
Here's something else that might help you from codeplex. It seem to have an interface called
ICryptoGetTextPassword
that you might be able to use if the 7z is password protected.Edit
With a bit further look at SevenZipSharp it seems that it should support password protected archives accroding to their project page ( http://sevenzipsharp.codeplex.com/ ):
You need to download the latest code from Codeplex and build it yourself, in it you will have a class called
SevenZipExtractor
where you have the following constructor:Note this is not the same as Seven7Sharp, this is SevenZipSharp, but it works with
7z
.