我目前正在解決從.net應用程序啓動外部工具的問題。 我有這部分代碼:發送提示輸入到Diagnostics.Process
proc.StartInfo = new ProcessStartInfo(_app, _args);
proc.StartInfo.UseShellExecute = false;
proc.StartInfo.RedirectStandardInput = true;
proc.StartInfo.RedirectStandardOutput = true;
proc.StartInfo.RedirectStandardError = true;
proc.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
但是,啓動應用程序後,我得到一個錯誤StandartError輸出WITN PROMT確認答案「中輸入Y/N」。 我已經嘗試通過標準輸入輸入「y」,在啓動過程之後,但仍然得到相同的錯誤。
var standartInput = proc.StandardInput;
standartInput.AutoFlush = true;
standartInput.WriteLine("y");
standartInput.Close();
我真的很感激任何幫助。謝謝。
PS:PuTTY Secure Copy客戶端 - 是我從代碼中使用的外部應用程序。第一次運行應用程序以在系統註冊表中保存服務器指紋時,會出現一個確認提示。
你必須告訴我們關於外部.net應用程序,它有什麼期望。這裏很難說出你遇到的問題。 – abhilash 2012-04-18 08:32:57
好的,更新後的帖子。 – 2012-04-18 08:51:45
謝謝,你能給我們提供一些你期望通過PSCP的虛擬參數嗎? – abhilash 2012-04-18 08:55:58