The management of cmd from Windows Forms?

Please help
Question: I want to manage cmd.exe from winforms.

I don'T mean each run in a separate process
I mean, for example, to run the command prompt to send ftp command to get a response, send the following command to get the following answer

I basically want to write GUI on top of any console application.

I want to input data received from the input line and the output cmd.exe forwarded to a multiline text box

All commands should be run in the same cmd is NOT in the new process!
It is desirable to write a function that will accept commands and return a response.
5ccb0e433b8e6214111587.jpegI tried that, but it runs only 1 team
string ExecuteCMD(string CMDLine)
{
 PsiOpt ProcessStartInfo = new ProcessStartInfo("cmd.exe", "/c " + CMDLine);
 psiOpt.WindowStyle = ProcessWindowStyle.Hidden;
 psiOpt.RedirectStandardOutput = true;
 psiOpt.UseShellExecute = false;
 psiOpt.CreateNoWindow = true;
 Process procCommand = Process.Start(psiOpt);
 StreamReader srIncoming = procCommand.StandardOutput;
 return srIncoming.ReadToEnd();
 }
March 20th 20 at 11:31
1 answer
March 20th 20 at 11:33

Find more questions by tags C#Visual Studio