Unzip password protected file in SSIS using Ionic.Zip dll

血红的双手。 提交于 2020-01-21 21:49:02

问题


I got requirement to unzip a file which contains password protected text files in zip file.which have to be done in SSIS package..

I have googled and download a dll called Ionic.Zip to used in script task.

i have used the below code using c# in script task..

  using Ionic.Zip;



  public void Main()        
  {             
    Dts.TaskResult = (int)ScriptResults.Success;
    start obj= new start();
    obj.decrypt();
  }
  public class start
   {
     public void decrypt()
       {
        string sfilepath ="E:\\shekar\\CIF_Files\\USAGE.zip";                       

        ZipFile fileToExtract = new ZipFile(sfilepath);
        fileToExtract.Password = "ftp122";
        fileToExtract.ExtractAll("E:\\shekar\\CIF_Files");
        }
    }

But i am getting an exception msg as below

I Had google a lot. but can't find correct solution. does any one prove me answer


回答1:


Take a look at the below. It will give you an idea of how it's being used in C# environment. Remember to check all the different Solutions:

link



来源:https://stackoverflow.com/questions/30936791/unzip-password-protected-file-in-ssis-using-ionic-zip-dll

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