阅读背景:

如何将ctrl+c发送到c#中的一个进程?

来源:互联网 

I'm writing a wrapper class for a command line executable. This exe accepts input from stdin until i hit ctrl+c in the command prompt shell, in which case it prints output based on the input to stdout. I want to simulate that ctrl+c press in c# code, sending the kill command to a .Net process object. I've tried calling Process.kill(), but that doesn't seem to give me anything in the process's StandardOutput StreamReader. Might there be anything I'm not doing right? Here's the code I'm trying to use:I'm writing a wrapper class for a command line




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: