1

I have a quite small (so far) project which consists of

  • Core
  • GUI
  • TUI

The TUI (console application) is communicating with another console application in order to send and retrieve certain information.

The purpose of the GUI is to make it easier.

However, I am stuck on how would I make my TUI communicate with my GUI. So far, I know I can start my TUI from the GUI like this:

System.Diagnostics.Process.Start(@"cmd.exe", @"/k C:\project\TUI\bin\Debug\TUI.exe");

But now, I do not have any reference to the console application and I do not know to send information forth and back. I tried to search for the answer, but my search would only lead to how to start them in a normal way (not both, together, communicating).

So all in all, my question is: How to start a console application from windows forms project so those two to be able to communicate?

Nikola
  • 2,093
  • 3
  • 22
  • 43
  • You need to search for "interprocess communication".In the past I've used the Mutex Class for this. Check also this http://stackoverflow.com/questions/528652/what-is-the-simplest-method-of-inter-process-communication-between-2-c-sharp-pro and this http://stackoverflow.com/questions/18437474/inter-process-communication-options – George Vovos Aug 05 '15 at 10:25

1 Answers1

0

You can use the Input and Outut Streams of the Process.

Read this :

https://msdn.microsoft.com/de-de/library/system.diagnostics.process.standardinput(v=vs.110).aspx

sven
  • 173
  • 1
  • 1
  • 10