TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Poppa Wallace
NA
189
24.2k
How to write to console app with hidden window
Dec 20 2016 8:03 AM
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
Reply
Answers (
3
)
System.AggregateException' in mscorlib.dll in SignalR
DataReader vs DataSet