How do I read what is being displayed in a cli process that my program starts?
defiant91
0
Newbie Poster
Recommended Answers
Jump to PostElaborate your question please.
Jump to PostTry
textBox1.Text = Console.In.ReadLine()
Jump to PostIf you have control of the executing assemblies then just wrap your Console.Write() methods so you know what data is being displayed. If you don't then you will need to redirect stdout and stderr which can be done with the Process.
System.Diagnostics.Process.GetCurrentProcess().StandardOutput System.Diagnostics.Process.GetCurrentProcess().StandardError
Jump to PostYou need to create another thread to monitor the streams for data changes and report it back to your UI thread.
All 14 Replies
kvprajapati
1,826
Posting Genius
Team Colleague
defiant91
0
Newbie Poster
kvprajapati
1,826
Posting Genius
Team Colleague
defiant91
0
Newbie Poster
sknake
1,622
Senior Poster
Featured Poster
defiant91
0
Newbie Poster
sknake
1,622
Senior Poster
Featured Poster
defiant91
0
Newbie Poster
defiant91
0
Newbie Poster
GeekByChoiCe
152
Practically a Master Poster
Featured Poster
defiant91
0
Newbie Poster
GeekByChoiCe
152
Practically a Master Poster
Featured Poster
defiant91
0
Newbie Poster
GeekByChoiCe
152
Practically a Master Poster
Featured Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.