
Untitled
By: a guest on
May 26th, 2012 | syntax:
None | size: 0.51 KB | hits: 19 | expires: Never
Executing a unix style piping command?
.binary.exe < input > output
ProcessStartInfo info = new ProcessStartInfo("binary.exe");
info.RedirectStandardInput = true;
info.RedirectStandardOutput = true;
Process p = Process.Start(info);
string Input;
// Read input file into Input here
StreamWriter w = new StreamWriter(p.StandardInput);
w.Write(Input);
w.Dispose();
StreamReader r = new StreamReader(p.StandardOutput);
string Output = r.ReadToEnd();
r.Dispose();
// Write Output to the output file
p.WaitForExit();