Schlagwort: Console

Java: Reading output from the Console/StdOut

Today I had a small problem. I wanted to start an external C++ console programm with some parameters and get the output back to my Java program. Here is a code snippet that reads the output from a console program: import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class Main { public static void main(String[] args) …

weiterlesen »

C#–Read STDOUT from a console application

Recently I needed to start a console application from C#, wait until the execution has finished and read the output back. Here is a simple way this can be done. The first thing is to run the process and attach an EventHandler for the finish of the process: Process process = new Process(); process.StartInfo.FileName = …

weiterlesen »