how to read a password protected zip file in c#

筅森魡賤 提交于 2019-12-12 07:05:31

问题


suggest me to read password protected zip file using c#


回答1:


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.




回答2:


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).



来源:https://stackoverflow.com/questions/1998168/how-to-read-a-password-protected-zip-file-in-c-sharp

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!