Run interactive command line exe using c#

前端 未结 3 1410
醉酒成梦
醉酒成梦 2020-12-05 08:17

I can run a command line process using process.start(). I can provide input using standard input. After that when the process demands user input again, how can

3条回答
  •  南方客
    南方客 (楼主)
    2020-12-05 09:08

    If I understand correctly I think you should be able to do this by redirecting the Standard Input/Output using RedirectStandardOutput and RedirectStandardInput.

    The WinSCP project has a C# sample for how to communicate with it using this way. You can find it here: SFTP file transfers in .NET (though this sample only collects the output without using it at all, but the technique should be the same.)

提交回复
热议问题