Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- System.Diagnostics.Process process = new System.Diagnostics.Process();
- System.Diagnostics.ProcessStartInfo startInfo = new System.Diagnostics.ProcessStartInfo();
- startInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;
- startInfo.FileName = "cmd.exe";
- startInfo.Arguments = "/C SomeEXE inputfile.txt";
- startInfo.UseShellExecute = false;
- startInfo.RedirectStandardOutput = true;
- process.StartInfo = startInfo;
- process.Start();
- // Now use streams to capture the output
- StreamReader outputReader = process.StandardOutput;
- process.WaitForExit();
- String line = outputReader.ReadToEnd();
- startInfo.FileName = "SomeEXE";
- startInfo.Arguments = "inputfile.txt";
- myProcess.StartInfo.RedirectStandardInput = true;
- StreamWriter myStreamWriter = myProcess.StandardInput;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement