简体   繁体   English

如何知道命令提示符的状态?

[英]How to know status of Command Prompt?

I opened a Command Prompt in my system and I'm passing some series of commands to it using System.Windows.Forms.SendKeys.Send(key); 我在系统中打开了一个命令提示符,并使用System.Windows.Forms.SendKeys.Send(key);向其中传递了一系列命令System.Windows.Forms.SendKeys.Send(key); method. 方法。

Now is it possibel to get the status of command prompt that means whether it is executing command or it is in idle state and how to know which command it is executing at particular time? 现在是否有可能获得命令提示符的状态,这意味着它是正在执行命令还是处于空闲状态,以及如何知道在特定时间正在执行哪个命令?

Use StartInfo.RedirectStandardOutput See this post: 使用StartInfo.RedirectStandardOutput参见此文章:

Piping in a file on the command-line using System.Diagnostics.Process 使用System.Diagnostics.Process在命令行上管道文件

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM