K
Kim P
Hi guys,
I am currently trying to make a small application that creates a process,
which runs a console application. The console application needs input in
three sequential steps, and will then terminate.
I have tried using the following approach:
proc.StartInfo.UseShellExecute = false;
proc.StartInfo.RedirectStandardOutput = true;
etc...
I even create an eventhandler in order to capture the output from the
console application.
proc.OutputDataReceived += new DataReceivedEventHandler(outputHandler);
This works fine when running an application which runs through all the way
and then exits - but it fails when the console application is pausing,
waiting for user input. The eventhandler never gets called, and I am
unsuccessful in using a StreamWriter to enter input to the console
application.
Anyone got an idea why I cant read output before the application has
successfully exited? And can the "automatic" interaction be done somehow?
Thanks in advance!
Kim P
I am currently trying to make a small application that creates a process,
which runs a console application. The console application needs input in
three sequential steps, and will then terminate.
I have tried using the following approach:
proc.StartInfo.UseShellExecute = false;
proc.StartInfo.RedirectStandardOutput = true;
etc...
I even create an eventhandler in order to capture the output from the
console application.
proc.OutputDataReceived += new DataReceivedEventHandler(outputHandler);
This works fine when running an application which runs through all the way
and then exits - but it fails when the console application is pausing,
waiting for user input. The eventhandler never gets called, and I am
unsuccessful in using a StreamWriter to enter input to the console
application.
Anyone got an idea why I cant read output before the application has
successfully exited? And can the "automatic" interaction be done somehow?
Thanks in advance!
Kim P