我正在尝试使用 Rebex 库创建受密码保护的 zip 文件。
这是我使用的代码
using (ZipArchive zip = new ZipArchive(ZipFilePath, ArchiveOpenMode.Create))
{
// Set the Password first
zip.Password = strUserPIN;
// Change the default Encryption algorithm
zip.EncryptionAlgorithm = EncryptionAlgorithm.Aes256;
// Add the file to newly created "files" folder within the zip file
zip.AddFile(Temp_BPI_SaveLocation + strDataFilewithTimeStamp, @"\files\");
//Save the Zip file
zip.Save();
// cloase the zip file
zip.Close();
}
但是,当我尝试打开文件时,我没有得到预期的“需要密码”对话框。
相反,我收到错误消息“Windows 无法完成提取。无法创建目标文件'
我确实需要获得预期的“需要密码”对话框,以便正确提取文件
有没有人处理过这个问题并找到了解决方案?