473,396 Members | 1,942 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,396 software developers and data experts.

How do I redirect output from a DOS app into DotNet app (pipe)

I want to take the output of a DOS console application that just streams data
to the screen and redirect that output in real time into a C# application
that will decode and reformat it for display. I know I could redirect from
the DOS application into a file and then read the file, but I want to do this
in real-time so I can affect the output of the DOS application and
immediately see the results in the C# app.

The DOS application is not ours, and there is no option to re-write it.

Can anyone point me in the right direction to get this done, or tell me why
it can’t?

Aug 12 '05 #1
1 2960
You need to to start the DOS application from within your C# application
using the System.Diagnostics.Process and System.DiagnostivsProcessInfo
classes. When you are setting up the info to start the process using the
ProcessInfo class you can redirect the standard output stream of the dos
application and send it to a StreamReader or some other .NET class that
derives from System.IO.Stream.

Hope this helps
--
Brian Delahunty
Ireland

http://briandela.com/blog

INDA SouthEast - http://southeast.developers.ie/ - The .NET usergroup I
started in the southeast of Ireland.
"Byron" wrote:
I want to take the output of a DOS console application that just streams data
to the screen and redirect that output in real time into a C# application
that will decode and reformat it for display. I know I could redirect from
the DOS application into a file and then read the file, but I want to do this
in real-time so I can affect the output of the DOS application and
immediately see the results in the C# app.

The DOS application is not ours, and there is no option to re-write it.

Can anyone point me in the right direction to get this done, or tell me why
it can’t?

Aug 12 '05 #2

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

Similar topics

2
by: Achim Domma | last post by:
Hi, I try to start a process on windows using win32process.CreateProcess and want to to redirect the output. I set the STARTF_USESTDHANDLES flag in the STARTUPINFO structure. But I can not...
2
by: Jason | last post by:
Hello, I have a class, transCore, that does certain work, and by default, prints its progress to the stand output. Later, I will to write a GUI class that encapsulate the transCore class. I...
2
by: Byron | last post by:
I want to take the output of a DOS console application that just streams data to the screen and redirect that output in real time into a C# application that will decode and reformat it for display....
2
by: 28tommy | last post by:
Hi there, I'm doing some TELNET and FTP sessions with my scripts. I need to redirect all the output (and not just what I print) to an output file, but still be able to see the session in process...
1
by: abcd | last post by:
I have a program which is written in C and interfaced with python via Swig. However, the function I call prints stuff out to the console. I would like to capture what it is printing out. I...
3
by: bonzo | last post by:
Hi, I have one external executable file that opens a file output.txt and writes something to that file. I need to catch anything that goes to that file and save it to a string object. I suppose i...
5
by: ws.taylor | last post by:
I am in a systems programming class, using C on a Solaris 10 development server. Part of the first programming assignment calls for the output of a command executed by a child process with execvp...
0
by: shravagiparag | last post by:
Hello, I am developing a console application to invoke gdb session and log in the communication between my application and gdb. I opened gdb as a new process and tried to redirect the input and...
2
by: ashokd001 | last post by:
Hi , How do i redirect output of topas to a file. i did not find any such option in topas command. Regards, Ashok
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.