简体   繁体   中英

Unzip password protected file in SSIS using Ionic.Zip dll

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM