Is there a simple way how to launch a process in .NET and redirect its output(s) to a file?
I know that in Win API I can pass a file handle to the CreateProcess
function.
In .NET I can do something like
startInfo.RedirectStandardOutput = true;
and then use BeginOutputReadLine
and StandardOutput
to get the data and save it to a file. But it seems a bit overhead compared to what OS can handle itself.
Thanks