【发布时间】:2020-01-21 13:52:02
【问题描述】:
我想在 ssis 中使用脚本任务在处理后发送特定文件夹中的文件我该怎么做? 谢谢你
【问题讨论】:
-
您可以使用 SSIS 将文件移动到新文件夹(我实际上建议使用 2 个对象复制然后删除 vs 1 个移动)
-
您的意思是“发送”带有附件的电子邮件吗?
我想在 ssis 中使用脚本任务在处理后发送特定文件夹中的文件我该怎么做? 谢谢你
【问题讨论】:
移动文件应该不是问题。 Take a look at this。您可以将文件的路径作为变量传递。
using System.IO;
string path = (string)Dts.Variables["User::path1"].Value;;
string path2 = (string)Dts.Variables["User::path2"].Value;;
try
{
// Ensure that the target does not exist.
if (File.Exists(path2))
File.Delete(path2);
// Move the file.
File.Move(path, path2);
}
【讨论】: