- private void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e)
- {
- _process = new Process();
- _process.StartInfo.FileName = @"//myconsolaeapp";
- _process.StartInfo.UseShellExecute = false;
- _process.EnableRaisingEvents = true;
- _process.StartInfo.CreateNoWindow = true;
- _process.StartInfo.RedirectStandardOutput = true;
- _process.OutputDataReceived += OutputHandler;
- //_process.Exited += (ErrorHandler);
- _process.SynchronizingObject = richTextBox1;
- _process.SynchronizingObject = richTextBox1;
- _process.Start();
- _process.BeginOutputReadLine();
- _process.WaitForExit();
- }
How to write to console app with hidden window
and other methods
- private void OutputHandler(Object source, DataReceivedEventArgs outLine)
- {
- if (!String.IsNullOrEmpty(outLine.Data))
- {
- richTextBox1.AppendText(outLine.Data + "\r\n");
- richTextBox1.ScrollToCaret();
- }
- }
Can anybody give me some hints please
Rathrola Prem KumarPosted Dec 20, 2016, 9:39 PM
Cassie ModPosted Dec 20, 2016, 7:37 PM
Amit GuptaPosted Dec 20, 2016, 9:55 AM