I want to capture output of a Perl program and display output data (string on screen) in a text box on C# Windows Form.
Here is my main C# code:
pu
First you have to update the event handler
void myProcess_OutputDataReceived(object sender, DataReceivedEventArgs e)
{
if (txtOutput.InvokeRequired)
{
UpdateUIDelegate updateDelegate = new UpdateUIDelegate
(UpdateUI);this.Invoke(updateDelegate, e.Data);
}
else UpdateUI(e.Data);
}
and add this line in your btnRun_Click
proc.WaitForExit();