使用Ionic.Zip DLL在SSIS解压密码保护的文件 [英] Unzip password protected file in SSIS using Ionic.Zip dll

查看:578
本文介绍了使用Ionic.Zip DLL在SSIS解压密码保护的文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有要求,解压缩包含在压缩密码保护的文本文件fil​​e.which在SSIS包..

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

我用Google搜索和下载要做一个文件一个名为Ionic.Zip DLL在脚本任务中使用。

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

我已经使用使用C#中的脚本任务。

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

推荐答案

可以确保以下两个步骤都做了什么?

Can you make sure below two steps are done?


  1. 注册在GAC定义DLL(确保dll是签订强密钥..大多数第三方DLL是签名,希望你被覆盖)

  2. 将您的dll在以下位置
    C:\Program文件(x86)\Microsoft SQL Server\\SDK\Assemblies\
    C:\Program Files\Microsoft的SQL Server \\SDK\Assemblies\

这就是它。检查的这个博客帖子获取更多信息。

Thats it.. Check this blog post for more info

这篇关于使用Ionic.Zip DLL在SSIS解压密码保护的文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆