日期:2014-05-18  浏览次数:21267 次

C#窗体调用控制台问题
将窗体的textbox作为输入和输出,以替代控制台输入输出。但用了ProcessStartInfo.argument后,参数无法传入到控制台的用console.read作为输入的参数。

------解决方案--------------------
要使用ProcessStartInfo.argument 

在console 程序中的 public void Main(string[] args)

用这个args即可。

如果想交互输入,不要用console.Read
而要用输入流Console.SetIn(TextReader in)来获取
写入Process的StandardIn 来调用 。