Tech
Forums
Jobs
Books
Events
Interviews
Live
More
Learn
Training
Career
Members
Videos
News
Blogs
Login
Sign Up
Ask Question
3
Reply
How to write to console app with hidden window
Poppa Wallace
Dec 20 2016 8:03 AM
293
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
Upload Source Code
Select only zip and rar file.
Post
Reset
Cancel
Answers (
3
)
Next Recommended Forum
System.AggregateException' in mscorlib.dll in SignalR
does anyone knows a good calender c#