我的任务很简单:我有一个密码保护的 zip 文件,我知道它的密码。 我只想取消密码保护。
我知道使用 DotnetZip我可以打开密码 protectez zip 文件,然后将文件复制到一个新的、未 protected 存档中。但挑战是我想避免复制压缩文件。因此,应该针对同一个文件“就地”删除密码,因为这样效率更高,而且我不再需要受密码保护的文件。
请您参考如下方法:
来自 DotNetZip Library - how to remove a zip password? :
The password in a zipfile is used to encrypt the entry data. As a result, "removing a password" involves decrypting the entry data, and then rewriting the unencyrpted entry data back into a zip file. There is no other way around this "terrible thing".
