使用dotnetzip C#解密受密码保护的压缩文件 [英] Decrypting a password protected zipped file using dotnetzip C#

查看:897
本文介绍了使用dotnetzip C#解密受密码保护的压缩文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图通过DotNetZip提取压缩文件。该文件使用密码加密,需要重置或删除。我使用ExtractAll方法但收到异常:

I m trying to extract a zipped file through DotNetZip . The file is encrypted with a password and needs to be either reset or removed. I used ExtractAll method but received exception:

BadPasswordException was unhandled, the password didnot match.





我尝试过:



我的代码如下:



What I have tried:

My code is below:

using (Ionic.Zip.ZipFile zip = Ionic.Zip.ZipFile.Read(source_file))
{           
    zip.Password = "1234";
    zip.ExtractAll(dest_path, Ionic.Zip.ExtractExistingFileAction.OverwriteSilently);
}



希望建议


Hopes For suggestion

推荐答案

如果你不知道密码,那么你将会出现此错误。

如果没有正确的密码,就无法提取数据 - 这就是为zip数据应用密码的全部想法。

如果你没有它,请回复给你发送文件的人,然后问他们 - 我们无法帮助你,如果可以的话就不会帮助你:我们不宽恕,支持,或以任何方式,形式或方式协助生成恶意代码。这是专业开发人员的专业网站。
If you do not know the password, then you will get this error.
And there is no way to extract the data without the correct password - that is the whole idea of applying a password to zip data.
If you don't have it, go back to the person who sent you the file, and ask them - we cannot help you, and would not if we could: We do not condone, support, or assist in the production of malicious code in any way, form, or manner. This is a professional site for professional developers.


这篇关于使用dotnetzip C#解密受密码保护的压缩文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆