Home > Net >  Winform form how to invoke the console program?
Winform form how to invoke the console program?

Time:11-16

To perform a console application, winform redirects input and output, to let the console input text box with winform, output shows in winform Lable

CodePudding user response:

The Process of p=new Process ();
String output=p. tandardOutput. ReadToEnd ();

You give to the output assignment winform text box line


CodePudding user response:

Open your Windows window project, click the right mouse button, open the "properties" window, change the "output type" to "console application", will appear a console window,

CodePudding user response:

In the Process. The Start (ProcessStartInfo)
If you say "input" refers to "command line argument", the contents of a text box, then assigned to the Arguments,
If your "input" refers to the input in the command line window, you will need to redirect standard input, to write the contents of the textBox into StandardInput,

As for output, redirect and read StandardOutput.

CodePudding user response:

refer to the second floor interacting in a professional developer response:
open you the Windows of the window, the right mouse button click, open the "properties" window, change the "output type" to "console application", will appear a console window,


That won't do the console project

CodePudding user response:

reference X - I - n reply: 3/f
with the Process. The Start (ProcessStartInfo)
If you say "input" refers to "command line argument", the contents of a text box, then assigned to the Arguments,
If your "input" refers to the input in the command line window, you will need to redirect standard input, to write the contents of the textBox into StandardInput,

As for output, redirect and read StandardOutput,


Is not very good, how to redirect

CodePudding user response:

Direct search Process "redirect"

CodePudding user response:

reference 4 floor sinat_34293903 response:
that won't do the console project yao


Entangled with a word I don't see what's practical significance,

You need a process, it has a Windows window, at the same time also want to have a console window, the window of the certain operating network real-time console window also output text information, there is no title name for the party, will be subject to the acceptance test of the actual programming, the practical purposes shall prevail,

CodePudding user response:

At work I developed a habit, who with me to discuss "what is" and actually can't test "to do" are actually title party, and the title party a is the basic characteristics of labeling everywhere,

CodePudding user response:

refer to the eighth floor interacting in a professional developer response:
at work I developed a habit, who with me to discuss "what is" and actually can't test "to do" are actually title party, and the title of the party a is the basic characteristics of labeling everywhere,

Boss can see what is being asked before?

CodePudding user response:

Standard console program has an input stream, an output stream, can be redirected to the specified location (keyboard, monitor, printer, documents, etc.),
Process class implements the function of these, but you should be familiar with the console program, flow, redirection, such as concept, otherwise is not so easy to understand these actions (after all these concepts year too long).

CodePudding user response:

refer to the eighth floor interacting in a professional developer response:
at work I developed a habit, who with me to discuss "what is" and actually can't test "to do" are actually title party, and the title of the party a is the basic characteristics of labeling everywhere,

The meaning of the original poster is call console program, not to make the console application

CodePudding user response:

reference 4 floor sinat_34293903 response:
Quote: refer to the second floor interacting in a professional developer response:

Open your Windows window project, click the right mouse button, open the "properties" window, change the "output type" to "console application", will appear a console window,


That won't do the console project

That you don't have to operate, this program or form project, it's just more than a console window, I often do this, change back to the application form, the console window,
Why don't ask so many, according to the operation of the old man said at a time? Being incredibly still say? Reminds me of the teach someone said, since then, not taught him
  •  Tags:  
  • C#
  • Related