Do something like this (not tested):
ProccessInfo pi = new ProccessInfo("cmd.exe");
pi.RedirectStandardError=true;
pi.RedirectStandardInput=true;
pi.RedirectStandardOutput=true;
Process cmd = Process.Start(pi);
cmd.StandardInput.WriteLine("Dir");
MessageBox.Show(cmd.StandardOutput.ReadToEnd());
Watch out for deadlocks, those method are blocking!
Pengyu Hong said:
I want my .NET GUI program has a window for Console and can communicate with
the Console.
Thank you very much!
Pengyu