Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个控制台应用程序。这个应用程序首先询问姓名,然后输入您的信息,然后询问密码。现在我想用 c# 自动执行此操作。基本上我想开始这个过程并自动输入我的名字然后按回车然后输入密码。我找到了很多关于如何添加一个参数的信息,但这不是我想要的。
您需要在 ' 中设置RedirectStandardIn,ProcessStartOptions然后写入Process'StandardInput流。
RedirectStandardIn
ProcessStartOptions
Process
StandardInput