-1
在數據流任務中,我需要重定向每一行以執行exe,並獲取每行的輸出,與腳本組件類似。SSIS - 在DFT中,如何將每行輸入爲exe並讀取每行的輸出?
我試圖使用腳本組件中的進程,但它引發異常「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();
}
有什麼建議嗎?我想知道是否有更好的方法來做到這一點?