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

console output (stdout) redirection

I'm looking for a way to redirect console output in a way that would enable
me to create a frontend to a command line utility by parsing the command
line utility's output. I have been able to do this in C, but my lack of
experience in C/C++/Managed C++ is preventing me from creating a class that
makes these things accessible from managed code. The HowTo I read even
shows you how to hide the 'child' console window. I either need to figure
out how to port this C code to a managed C++ class or I need to find a way
to do this that's already built into the .NET framework. Any help or advice
would be appreciated. Here's Microsoft's HowTo on this:
http://support.microsoft.com/default...NoWebContent=1
Chris Lajoie
Nov 15 '05 #1
2 2651
Hi Chris,

Check out the System.Diagnostics.Process class. It has members that let you
redirect StandardOutput, StandardError, and StandardInput.

Joe
--
http://www.csharp-station.com

"Chris LaJoie" <ch***@etriptrader.com> wrote in message
news:uE**************@TK2MSFTNGP10.phx.gbl...
I'm looking for a way to redirect console output in a way that would enable me to create a frontend to a command line utility by parsing the command
line utility's output. I have been able to do this in C, but my lack of
experience in C/C++/Managed C++ is preventing me from creating a class that makes these things accessible from managed code. The HowTo I read even
shows you how to hide the 'child' console window. I either need to figure
out how to port this C code to a managed C++ class or I need to find a way
to do this that's already built into the .NET framework. Any help or advice would be appreciated. Here's Microsoft's HowTo on this:
http://support.microsoft.com/default...NoWebContent=1

Chris Lajoie

Nov 15 '05 #2
Also, I believe System.Environment has ways to redirect stdout, stderr
--
Eric Newton
C#/ASP Application Developer
http://ensoft-software.com/
er**@cc.ensoft-software.com [remove the first "CC."]

"Joe Mayo" <jm***@ddiieessppaammeerrssddiiee.com> wrote in message
news:uQ**************@tk2msftngp13.phx.gbl...
Hi Chris,

Check out the System.Diagnostics.Process class. It has members that let you redirect StandardOutput, StandardError, and StandardInput.

Joe
--
http://www.csharp-station.com

"Chris LaJoie" <ch***@etriptrader.com> wrote in message
news:uE**************@TK2MSFTNGP10.phx.gbl...
I'm looking for a way to redirect console output in a way that would

enable
me to create a frontend to a command line utility by parsing the command
line utility's output. I have been able to do this in C, but my lack of
experience in C/C++/Managed C++ is preventing me from creating a class

that
makes these things accessible from managed code. The HowTo I read even
shows you how to hide the 'child' console window. I either need to figure out how to port this C code to a managed C++ class or I need to find a way to do this that's already built into the .NET framework. Any help or

advice
would be appreciated. Here's Microsoft's HowTo on this:

http://support.microsoft.com/default...NoWebContent=1


Chris Lajoie


Nov 15 '05 #3

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

Similar topics

1
by: Oz | last post by:
This is long. Bear with me, as I will really go through all the convoluted stuff that shows there is a problem with streams (at least when used to redirect stdout). The basic idea is that my...
4
by: Bill Cohagan | last post by:
I'm writing a console app (in C#) and I want to be able to redirect the standard input/output streams when it's run at a command prompt. IOW I want to support the "<" and ">" redirection syntax....
1
by: noleander | last post by:
Hi. I've got a C++ program written in Visual C++ 2003. The program is trivial, created with the Program-creation wizard: used the .NET "Form" template. The program has a trivial...
7
by: Robert | last post by:
Hello, I'm using Pythonwin and py2.3 (py2.4). I did not come clear with this: I want to use win32-fuctions like win32ui.MessageBox, listctrl.InsertItem ..... to get unicode strings on the...
7
by: mabra | last post by:
Hi All ! Problem:Reading/duplicating "Console.In" fails for unknown reason. I wrote a little console helper tool, named TEE, which just duplicates the StdIn to the StdOut AND an additional...
3
by: robannexs | last post by:
Hi all, I'm doing a small c program which backs up the mbr of hard disk. Currently working in linux. what i did was : system("sudo dd if=/dev/sda of=mbr.bin bs=512 count=1"); This is the...
2
by: castironpi | last post by:
Presents a console permitting inspection. Input as well as output saved in Python-readable form. Python 2.5.1 memoryconsole4.py logging to My Documents\console.log .... def f( self ): .... ...
4
by: Dinsdale | last post by:
I am writing a small console application that runs fine unless I am re- directing the output to a file (i.e. c:\ app.exe >>output.txt) . I have determined that the issue is caused by the...
27
by: CarlosMB | last post by:
Hello, I am writing code that uses a DLL which is supposed to print to console some useful information but for some reason it is not doing so. The environment is a bit complex to explain but...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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...

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.