Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

C# Send Commands

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

like image 376
YoshieMaster Avatar asked Jun 19 '11 03:06

YoshieMaster


2 Answers

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.

like image 75
Lindsay Avatar answered Oct 04 '22 21:10

Lindsay


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)

like image 21
Mitch Wheat Avatar answered Oct 04 '22 22:10

Mitch Wheat