6

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#?

1
  • Is it expecting commands to be sent to it? Does it listening for it? Need more information on your command line program you have developed. Commented Jun 19, 2011 at 3:59

3 Answers 3

12

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.

Sign up to request clarification or add additional context in comments.

Comments

3

A few possibilities:

1 Comment

1

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).

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.