Question on Process.StandardOutput

G

Guest

If I redirect the console output using the standard method, it works fine if the process outputs all its information and then exits quite soon. But for processes that output information as they are processing, for instance osql.exe when processing a large job, it doesn't seem that any of the read methods on StandardOutput are able to get the output before the process has exited
Is this normal behaviour, and how can I get around it to put the output in (say) a listbox while the process is still running
What determines when the output can be 'read' by the redirection

Thanks
 
V

Vijaye Raji

The problem here is the output stream is not being flushed. I think you can
call Flush () on the BaseStream from time to time to read what's been
already output.

-vJ
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top