Win32 api for Process.BeginOutputReadLine
1 answer
To read the standard output of a process, you need to assign an appropriate handle to the instance STARTUPINFO
passed in CreateProcess
. Don't forget to include the flag STARTF_USESTDHANDLES
.
Typically, an anonymous channel created with CreatePipe
.
See " Creating a Child Process with Redirected I / O " for an example.
You can use the usual Win32 approaches (OVERLAPPED + event, IOCompleteion Port, ...) to read the output descriptor asynchronously.
+1
a source to share