Tech
Forums
Jobs
Books
Events
Videos
Live
More
Interviews
Certification
Training
Career
Members
News
Blogs
Contribute
An Article
A Blog
A Video
An Ebook
An Interview Question
Register
Login
3
Answers
How to write to console app with hidden window
Poppa Wallace
8y
324
1
Reply
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();
}
and other methods
private
void
OutputHandler(Object source, DataReceivedEventArgs outLine)
{
if
(!String.IsNullOrEmpty(outLine.Data))
{
richTextBox1.AppendText(outLine.Data +
"\r\n"
);
richTextBox1.ScrollToCaret();
}
}
I have a textbox that once text is changed it is written to my hidden console window and updated in the tichtextbox1.
Can anybody give me some hints please
Post
Reset
Cancel
Answers (
3
)
Next Recommended Forum
System.AggregateException' in mscorlib.dll in SignalR
does anyone knows a good calender c#