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.
我在我的系统中打开了一个命令提示符,并使用 System.Windows.Forms.SendKeys.Send(key);方法向它传递了一些命令。
System.Windows.Forms.SendKeys.Send(key);
现在是否有可能获得命令提示符的状态,这意味着它是正在执行命令还是处于空闲状态以及如何知道它在特定时间正在执行哪个命令?
使用StartInfo.RedirectStandardOutput看这篇文章:
StartInfo.RedirectStandardOutput
使用 System.Diagnostics.Process 在命令行上输入文件