Unzip password protected file in SSIS using Ionic.

2019-03-01 05:34发布

问题:

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



标签: c# dll ssis zip unzip