C
Charles Law
If I open a DOS console window (CMD) and enter "Netdiag /v", I get periodic
output showing the progress of the diagnostic tests being run.
If I create a Windows Forms app to run Netdiag using
System.Diagnostics.Process I can only get the output in a single block. That
is to say, if I redirect standard output to a stream, I can call ReadToEnd()
on the stream and when the process has finished I get a splurge of text to
output to the screen.
If I use Peek() in a loop to see when there is a character to read, it
always returns -1. It appears that although Netdiag is generating output, it
is not getting written to the stream.
Is there some way to read the output as it is generated, rather than all in
one hit at the end? I have tried putting each of the bits in their own
threads but it doesn't seem to make any difference.
TIA
Charles
output showing the progress of the diagnostic tests being run.
If I create a Windows Forms app to run Netdiag using
System.Diagnostics.Process I can only get the output in a single block. That
is to say, if I redirect standard output to a stream, I can call ReadToEnd()
on the stream and when the process has finished I get a splurge of text to
output to the screen.
If I use Peek() in a loop to see when there is a character to read, it
always returns -1. It appears that although Netdiag is generating output, it
is not getting written to the stream.
Is there some way to read the output as it is generated, rather than all in
one hit at the end? I have tried putting each of the bits in their own
threads but it doesn't seem to make any difference.
TIA
Charles