how to read a password protected zip file in c#

2019-12-16 19:44发布

suggest me to read password protected zip file using c#

标签: c# passwords zip
2条回答
Luminary・发光体
2楼-- · 2019-12-16 20:05

DotNetZip is a free open-source library for working with zip files. It supports password protected files so it should be just what you are after.

查看更多
放荡不羁爱自由
3楼-- · 2019-12-16 20:13

Following code shows how to decompress a password protected ZIP archive using our Rebex ZIP component.

// 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");
}

Free SharpZipLib might a be viable alternative (if you don't mind that it's licensed under LGPL).

查看更多
登录 后发表回答