且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

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

更新时间:2022-11-27 12:10:24

实际上我刚刚想出了答案.谢谢你们的回答,但事实证明我所要做的就是:

I've actually just figured out the answer. Thank you both for your answers, but it turns out that all i had to do was this:

p.StandardInput.Close()

这导致我生成的程序完成从标准输入读取并输出我需要的内容.

which causes the program I've spawned to finish reading from stdin and output what i need.