0

I apologise ahead of time because this is hard to explain.

I currently have two projects. One called 'Game' and one called 'Client'. Client is also a console application. I am wanting to make it so that I can call an instance of Client in Game, which then starts the application and returns all information to that instance call.

So the scenario is that my Game class starts up the Client console app alongside it, but all information entered in that console application can be access through the Client instance call in Game.

Basic Pseudo for explanation

[Game.cs]
Client cl = new Client();
Process p = Process.Start("Client.exe");

[Client.cs]
Connect();

So how would I be abled to call cl.Connect() in Game.cs making use of the process p?

gn12345
  • 335
  • 1
  • 3
  • 11
  • 1
    Possible duplicate of [Run console application from other console app](http://stackoverflow.com/questions/2366168/run-console-application-from-other-console-app) – Charles Mager Jun 01 '16 at 09:38
  • It isn't unfortunately, as I am wanting to run my Client application at the same time as the Game application. With the Client application feeding data 'live' to the Game application. – gn12345 Jun 01 '16 at 09:47
  • You will need multithreading then. look into the TPL (Task Parallel Library) – Mafii Jun 01 '16 at 09:49
  • 1
    @gn12345 It still sounds the same - you can start another console app and redirect its outputs and/or inputs. – Charles Mager Jun 01 '16 at 09:50
  • @CharlesMager Due to formatting please refer to edited question for response. – gn12345 Jun 01 '16 at 10:00
  • @gn12345 that wasn't really what your question implied. The way you 'feed data' into a console app is usually via a keyboard, and redirecting the input will let you do that from another app. It sounds like you want some sort of IPC solution. – Charles Mager Jun 01 '16 at 10:04

0 Answers0