How can I redirect everything written to the console to write to a string?
For your own Console.SetOut process and redirect it to a TextWriter created on top of a string builder or memory stream. To start a child process, use ProcessStartInfo.RedirectStandardOutput when starting the process.
Console.SetOut
ProcessStartInfo.RedirectStandardOutput
Use Console.SetOut ();
Console.SetOut ();
string consoleString = Console.ReadLine();