Forked from adrianstevens/gist:13698d6c7210b3855528
Last active
August 29, 2015 14:15
-
-
Save wcoder/44e1a52f91a5c8210c9f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Diagnostics; | |
using System.IO; | |
class Program | |
{ | |
static void Main() | |
{ | |
ProcessStartInfo start = new ProcessStartInfo(); | |
start.FileName = @"C:\someapp.exe"; // full path | |
start.UseShellExecute = false; | |
start.RedirectStandardOutput = true; | |
using (Process process = Process.Start(start)) | |
{ | |
// Read in all the text from the process using StreamReader | |
using (StreamReader reader = process.StandardOutput) | |
{ | |
string result = reader.ReadToEnd(); | |
Console.Write(result); | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment