SSIS - 在DFT中,如何将每行输入到exe并读取每行的输出?

时间:2014-03-12 23:01:52

标签: ssis dataflowtask

在数据流任务中,我需要将每一行重定向到exe并获取每行的输出,类似于脚本组件。

我尝试在脚本组件中使用Process,但它抛出异常“StandardOut尚未重定向或进程尚未启动。” 脚本组件中使用的代码是:

 Process myApp = new Process();
 myApp.StartInfo.FileName = @"Someexe.exe";
 myApp.StartInfo.Arguments = "param1";
 myApp.StartInfo.UseShellExecute = false;
 myApp.StartInfo.RedirectStandardOutput = false;

 myApp.Start();
 while (!myApp.HasExited)
 {
  string result= myApp.StandardOutput.ReadToEnd();
  }

有什么建议吗?我想知道是否有更好的方法可以做到这一点?

1 个答案:

答案 0 :(得分:0)

相关问题