I have a command line program running and I would like to send additional commands to it (I.E. Once it is already running) How can I do this in C#?
相关问题
- Sorting 3 numbers without branching [closed]
- Graphics.DrawImage() - Throws out of memory except
- Why am I getting UnauthorizedAccessException on th
- 求获取指定qq 资料的方法
- How to know full paths to DLL's from .csproj f
If the process is started by your C# program, then you can use Process.StandardInput to send commands to it.
If you are sending command to other processes, you can use the SendKey class as demoed in here.
If you are talking about an interactive console program you just need to use Console.Readline() to get the input from the console and process it in your code. If you are talking about something more complex read about Inter-process communication (IPC).
A few possibilities:
Handling Messages in Console Apps
How to send command to console application from GUI application
How can I send keypresses to a running process object? (from @Truewill)