[1.0/1.1] Output text to another console window
Code:
public static void send()
{
ProcessStartInfo exec = new ProcessStartInfo("cmd.exe");
exec.RedirectStandardInput = true;
exec.RedirectStandardOutput = true;
exec.RedirectStandardError = true;
exec.UseShellExecute = false;
Process p = Process.Start(exec);
System.IO.StreamWriter streamWriter = p.StandardInput;
System.IO.StreamReader streamReader = p.StandardOutput;
streamWriter.WriteLine("thread started");
for (int i = 0; i < 10; i++)
{
streamWriter.WriteLine("hello the time now is {0}",DateTime.Now.ToString("hh:mm:ss:fff "));
Thread.Sleep(500);
}
streamWriter.WriteLine("Thread Closing");
streamReader.Close();
}
I have this code but it seem's it doesn't show the console window w/ text in it.
What am I missing here?
BTW it's a console application that could open another console window and send text in it.
Thanks in advance for all help.
-mar_zim