473,325 Members | 2,608 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,325 software developers and data experts.

Directing Console.Out and Console.Error to a Textbox

I have a set of libraries that do processing output to Console.Out, and
Console.Error.

How do I direct that output to a Textbox on a Windows form in CSharp?

Thanks in advance!

- Nevyn
Nov 16 '05 #1
2 2620
For this you can route the In, Out, and Error objects used by the
console to your own objects. To do this simply use the Console.SetIn,
Console.SetOut, and Console.SetError equal to your object. SetIn will
accept a text reader while SetOut and SetError take text writers. Once
you've captured the output you can do what you'd like with it. Hope that
helps.

Have A Better One!

John M Deal, MCP
Necessity Software

Nevyn Twyll wrote:
I have a set of libraries that do processing output to Console.Out, and
Console.Error.

How do I direct that output to a Textbox on a Windows form in CSharp?

Thanks in advance!

- Nevyn

Nov 16 '05 #2
Just a note. The std output can and will stall your process if the std out
fills the stdout stream - which is not a lot of output (maybe a screen
full). So you may need a seperate thread to read process.stdout into your
own output stream until process done.

--
William Stacey, MVP
http://mvp.support.microsoft.com

"Nevyn Twyll" <as****@hotmail.com> wrote in message
news:e7**************@TK2MSFTNGP11.phx.gbl...
I have a set of libraries that do processing output to Console.Out, and
Console.Error.

How do I direct that output to a Textbox on a Windows form in CSharp?

Thanks in advance!

- Nevyn


Nov 16 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Jon Davis | last post by:
Does anyone know where I can get my hands on a textbox console, like the Immediate textbox in Visual Studio (any), in which I can map I/O streams such that a class library built for a console app...
1
by: Mullin Yu | last post by:
But, I want is that I can have a Main app that will start a new process or kill one particular or all process. The process will open a console exe. But, I don't want the user to close the console...
5
by: Peteroid | last post by:
I'm doing a managed C++ application. Is there a way to re-direct 'cout' to output destinations other than the 'black console' that comes up? Specifically, re-direction to a text file? Thanks in...
8
by: Alison | last post by:
Hi, Al I am trying to design a user interface which provides both menus and toolbars for some users to click on whatever they want to do, at the same time, I would like to have a console window...
4
by: ano | last post by:
I have a console application and a lot of Console.WriteLine(). Now I want to convert it to Windows Form Application. Is it possible to getting all of the console messages to Form.Textbox without...
2
by: alex | last post by:
Hi, I have several classes, which i use in my windows application. The classes uses console.writeline to print status information. Now i have a log-textbox in my windows application and i want...
2
by: Ken Williams | last post by:
In general the program is GUI based. However sometimes I would like to wirte some text lines to Console as if it is a Console program. When I write a System.ConsoleWriteLine() statement this...
4
by: =?Utf-8?B?RG91Z0U=?= | last post by:
Some people tryed to help in my previous post. But I don't quite have it. What I want to do is send stdout to something on a form textbox, panel, listbox -- something. I want to write to a form the...
1
by: aaronkmar | last post by:
Hi Bytes, Hope your day is going well and thank god it's Friday! I've got an IE only error kicking my butt. The java below is responsible for table row highlighting and a tool tip for one of...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.