使用 Ionic.Zip dll 在 SSIS 中解压缩受密码保护的文件 [英] Unzip password protected file in SSIS using Ionic.Zip dll
问题描述
我要求解压一个文件,其中包含 zip 文件中受密码保护的文本文件.这必须在 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..
我在谷歌上搜索并下载了一个名为 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");
}
}
但我收到如下异常消息
我谷歌了很多.但找不到正确的解决方案.有没有人证明我回答了
I Had google a lot. but can't find correct solution. does any one prove me answer
推荐答案
看看下面的内容.它将让您了解它是如何在 C# 环境中使用的.请记住检查所有不同的解决方案:
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:
这篇关于使用 Ionic.Zip dll 在 SSIS 中解压缩受密码保护的文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!