Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System; using System.Diagnostics;
- namespace LaunchAndCaptureOutput{
- class Lacout{
- static void Main(){
- var proc = new Process{
- StartInfo = new ProcessStartInfo{
- FileName = @"C:\csdev\lessons\lessonette7\hello.exe",
- UseShellExecute = false,
- RedirectStandardOutput = true,
- CreateNoWindow = true
- }
- };
- proc.Start();
- string p = proc.StandardOutput.ReadToEnd();
- proc.WaitForExit();
- Console.WriteLine("Captured output: " + p);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement