D
D
Dmitry Korolev2017-10-04 18:43:48
C++ / C#
Dmitry Korolev, 2017-10-04 18:43:48

How and use process output stream?

How to display process output stream?
When outputting a string there, it is necessary to display the string in this application in a timely manner

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sumor, 2017-10-04
@Sumor

Example from MSDN

Process compiler = new Process();
compiler.StartInfo.FileName = "csc.exe";
compiler.StartInfo.Arguments = "/r:System.dll /out:sample.exe stdstr.cs";
compiler.StartInfo.UseShellExecute = false;
compiler.StartInfo.RedirectStandardOutput = true;
compiler.Start();    

Console.WriteLine(compiler.StandardOutput.ReadToEnd());

compiler.WaitForExit();

UseShellExecute must be set to False otherwise it won't work.
Similarly, compiler.StandardIntput can be used to provide input as if from a console.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question