Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/reporting-services/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 将Ctrl+C发送到进程_C#_Winapi - Fatal编程技术网

C# 将Ctrl+C发送到进程

C# 将Ctrl+C发送到进程,c#,winapi,C#,Winapi,我必须将Ctrl+C发送到从我的C应用程序创建的控制台进程。我发现了很多类似的线程,但还没有找到解决方案,比如CreateProcess、GenerateConsolectElevent等。。有没有任何有效的例子 键CRTL+C是十进制的ASCII 3 myProcess.StartInfo.FileName = "Sort.exe"; myProcess.StartInfo.RedirectStandardInput = true; myProcess.Start(); StreamWrite

我必须将Ctrl+C发送到从我的C应用程序创建的控制台进程。我发现了很多类似的线程,但还没有找到解决方案,比如CreateProcess、GenerateConsolectElevent等。。有没有任何有效的例子

键CRTL+C是十进制的ASCII 3

myProcess.StartInfo.FileName = "Sort.exe";
myProcess.StartInfo.RedirectStandardInput = true;
myProcess.Start();
StreamWriter myStreamWriter = myProcess.StandardInput;
myStreamWriter.WriteLine(inputText);
Ref:

键CRTL+C是十进制的ASCII 3

myProcess.StartInfo.FileName = "Sort.exe";
myProcess.StartInfo.RedirectStandardInput = true;
myProcess.Start();
StreamWriter myStreamWriter = myProcess.StandardInput;
myStreamWriter.WriteLine(inputText);

Ref:

看起来好像不起作用。我将3写入输入流,但没有任何成功。您是如何将3写入流的?3或char.ConvertFromUtf323。如果这样做有效,请投票:我刚刚录制了字节3。我还尝试了char.ConvertFromUtf323-它也不工作。char.ConvertFromUtf323工作得很好。我用它来关闭GPRS连接。看起来好像不起作用。我将3写入输入流,但没有任何成功。您是如何将3写入流的?3或char.ConvertFromUtf323。如果这样做有效,请投票:我刚刚录制了字节3。我还尝试了char.ConvertFromUtf323-它也不工作。char.ConvertFromUtf323工作得很好。我用它来关闭GPRS连接。