2 using System
.Diagnostics
;
3 using System
.Threading
;
7 Process proc
= new Process();
10 proc
.StartInfo
.FileName
="wibble-redir";
11 proc
.StartInfo
.Arguments
="arg1 arg2\targ3 \"arg4a arg4b\"";
12 proc
.StartInfo
.UseShellExecute
=false;
13 proc
.StartInfo
.RedirectStandardInput
=true;
16 Console
.WriteLine("Start returns " + ret
);
17 Console
.WriteLine("Process is " + proc
.ToString());
18 Console
.WriteLine("Pid is " + proc
.Id
);
19 Console
.WriteLine("Handle is " + proc
.Handle
);
20 Console
.WriteLine("HandleCount is " + proc
.HandleCount
);
22 Console
.WriteLine("Writing [foo bar]");
23 proc
.StandardInput
.WriteLine("foo bar");
25 System
.Threading
.Thread
.Sleep(1000);
27 Console
.WriteLine("Writing [wibble wobble]");
28 proc
.StandardInput
.WriteLine("wibble wobble");
30 System
.Threading
.Thread
.Sleep(1000);
32 Console
.WriteLine("Closing stdin");
33 proc
.StandardInput
.Close();
35 Console
.WriteLine("Waiting for exit...");
37 Console
.WriteLine("Wait returned");
38 Console
.WriteLine("Exit code is " + proc
.ExitCode
);
39 Console
.WriteLine("Process started at " + proc
.StartTime
);
40 Console
.WriteLine("Process ended at " + proc
.ExitTime
);