阅读加密的zip并解压缩服务器中的zip

时间:2017-10-12 14:12:31

标签: c# zipfile

我正在使用此代码在服务器中解压缩和加密zip文件。但是它给了我一个错误 - 无法将其读作ZipFile。这有什么不对?

string extractPath = servermapPath;
ZipFile zip = new ZipFile();
if (zipPath != "")
{
    zip = ZipFile.Read(zipPath);
    Directory.CreateDirectory(extractPath);
    foreach (ZipEntry e in zip)
    {
        //e.Extract(extractPath, ExtractExistingFileAction.OverwriteSilently);      //It is for Normal Zip File.
        e.ExtractWithPassword(zipPath, "#####");
        UnzipFileExt = e.FileName;
    }
}

0 个答案:

没有答案