Say I ran my program:
Process proc = new Process();
proc.StartInfo.FileName = Path.GetDirectoryName(Application.ExecutablePath)
+ @"\Console.exe";
proc.Start();
And then you want to output my console stream to this application, how would I do it? So say that I have:
Console.WriteLine("HEY!");
I want this to appear in the program in which I started the console. I know that I need to redirect the output using
Console.SetOut(TextWriter);
But I have no idea how I'm going to record in another program.
I can figure out how to do this if I run my main program from Console.exe using RedirectStandardInput .. but this does not help: P
source
share