将命令注入基于命令行的进程
目前我正在从事服务器管理工作。服务器是一个命令行应用程序。服务器通过Process类运行,并且窗口是隐藏的。我一直在试图找出一种将命令注入其中(全部保存)而不显示服务器窗口的方法。我尝试使用 StreamWriter 和进程的标准输入,但这不起作用。有谁知道如何让它发挥作用?
Currently I am working on a server manager. The server is a command line application. The server is ran through the Process class, and the window is hidden. I've been trying to figure out a way to inject commands into it (save-all), without showing the server window. I have tried to use StreamWriter and the Process's Standard Input, but that didn't work. Does anyone know how to get this to work?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
为了能够重定向进程的任何标准 I/O 流,您需要禁用 shell 执行。你可能没有。你应该能够这样做:
To be able to redirect any of the standard I/O streams of a process, you need to disable shell execute. You probably didn't. You should be able to do it like this: