-1
建议我使用C#如何阅读在C#中的受密码保护的zip文件
建议我使用C#如何阅读在C#中的受密码保护的zip文件
DotNetZip是与zip文件的工作一个免费的开源库来读取密码保护的zip文件。它支持密码保护的文件,所以它应该就是你以后的样子。
以下代码显示了如何使用我们的Rebex ZIP component解压密码保护的ZIP存档。
// open a ZIP archive
using (ZipArchive zip = new ZipArchive(@"C:\archive.zip", ArchiveOpenMode.Open))
{
// set the Password first
zip.Password = "PASSword#123";
// extract whole ZIP content
zip.ExtractAll(@"C:\Data");
}
免费SharpZipLib可能是一个可行的选择(如果你不介意的话,它的LGPL许可)。
可能的重复[如何使用密码ZIP和UnZIP - 在C#程序?](http://stackoverflow.com/questions/1607858/how-to-zip-and-unzip-using-password-in-c -程序) – 2010-10-12 18:04:04