C # can add command line control to my application

The name says it. I know that I can use Process or ProcessStartInfo to run the arguments, but I mean actually adding the command line control to my application (because I use it very often, and it would be convenient if it was already built-in.

Is there a way to do this differently than coding a user control? If not, I can live with him, but it will definitely help.

+3
source share
3 answers

What is the problem with executing Console.ReadLine () / Console.WriteLine () in a loop? This is the most effective way, and you have complete control over what you are doing.

-2

- ( ):

ProccessInfo pi = new ProccessInfo("cmd.exe");
pi.RedirectStandardError=true;
pi.RedirectStandardInput=true;
pi.RedirectStandardOutput=true;
Process cmd = Process.Start(pi);
cmd.StandardInput.WriteLine("Dir");
textBox1.Text = cmd.StandardOutput.ReadToEnd();

, !

codeproject.com: http://www.codeproject.com/KB/miscctrl/commandprompt.aspx

+2

. . , .

win app, , .

-1

Source: https://habr.com/ru/post/1770723/


All Articles