the final application does not intercept the console
-
Hello, there's a problem: there's a rouble interpreter, and if you feed him (through cmd) a file containing nonsense, it's natural to generate a misstatement. However, if an attempt is made to feed the file through the annex windows forms, the erroneous information is not ejected ( is not clear at all). What am I doing wrong? Here's the code.
namespace RubyIDE { public partial class Form1 : Form { public Form1() { InitializeComponent(); }
private void runToolStripMenuItem_Click(object sender, EventArgs e) { System.IO.File.WriteAllText("H:\\2.rb", textBox1.Text); var psi = new ProcessStartInfo { FileName = "ruby.exe", Arguments = "H:\\2.rb", RedirectStandardOutput = true, UseShellExecute = false }; var p = Process.Start(psi); textBox2.Text = p.StandardOutput.ReadToEnd(); } ... }
}
I'll explain, rouble the code that is provided to the interpreter, inserted into textBox1 and copied in file H:\2.rb, followed by an interpreter (ruby.exe) and textBox2 contains error reports (if any). The problem is, textBox2 remains empty, even when mistakes are available and information about them is made to the console. Anyway, we need to make sure that the information on the errors in the violin 2.rb is in textBox2. I would be very grateful for your help.
-
Try not to read it.
StandardOutput
♪StandardError
♪ It's quite possible that the erroneous report is written in this line.P.S. And after reading the outside, it's better to wait for the end of the process:
p.WaitForExit()