473,659 Members | 2,920 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to capture console app output?

Hi,

In Win App, I used Process class to start a new console appliaction, is it
possible to capture the console output and display them in a textbox?

Thanks very much!

John
Nov 15 '05 #1
2 5384
John <jo*********@pu rsca.com> wrote:
In Win App, I used Process class to start a new console appliaction, is it
possible to capture the console output and display them in a textbox?


Yes - you need to redirect the output to a stream. See the
RedirectStandar dOutput and RedirectStandar dError properties of
ProcessStartInf o.

--
Jon Skeet - <sk***@pobox.co m>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 15 '05 #2
Perfect! Thanks very very much!!!

John

"Jon Skeet [C# MVP]" <sk***@pobox.co m> wrote in message
news:MP******** *************** *@msnews.micros oft.com...
John <jo*********@pu rsca.com> wrote:
In Win App, I used Process class to start a new console appliaction, is it possible to capture the console output and display them in a textbox?


Yes - you need to redirect the output to a stream. See the
RedirectStandar dOutput and RedirectStandar dError properties of
ProcessStartInf o.

--
Jon Skeet - <sk***@pobox.co m>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too

Nov 15 '05 #3

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

Similar topics

2
5979
by: Jose | last post by:
There's something for me to learn with this example, i'm sure :) Given this text: "....." and my first attempt at capture the groups: "(?:\)" RegExTest gives me what i expect: 6 captured groups: Contact, Region, All ContractRegion, ASIA PACIFIC, Japan, Japan. However, with this C# code, i just get 2 capture groups: ",
7
2361
by: thompson_38 | last post by:
I have a COM object that wraps a console application. This console app outputs strings, using tprintf statements, throughout execution. I would like to capture that output from the console app and display it in my C# Windows.Forms test application. I have tried StreamWriter, StringWriter, OpenStandardOutput, but I only get empty strings returned. I do not want to change the console application nor the COM app. I am still investigating,...
1
1596
by: Anoj Kumar | last post by:
Hi Guys! How to capture output of a console based program and display it on Windows Forms applcation. Thx Anoj Kumar
9
18282
by: Santtu Nyrhinen | last post by:
Hi, Let say that I have a function like void writeHello() { printf("Hello"); } Now I need to make an automated test fot that function. The test function returns 1 for successful and 0 for unsuccessful test. int Test_writeHello() {
4
1141
by: George Lake | last post by:
Hi, How can I capture the text output of a console app? For example, I would like to capture the outpur of "qwinsta" Thanks.
2
3059
by: IchBin | last post by:
I have no problem doing this in Java. I am new to PHP. How do you, using a PHP script, run a windows DOS.bat file and capture all of its console for further processing? -- Thanks in Advance... IchBin, Pocono Lake, Pa, USA http://weconsultants.phpnet.us __________________________________________________________________________ 'If there is one, Knowledge is the "Fountain of Youth"'
5
7167
by: Muffin | last post by:
I am trying to capture the out put of a command line program. Let say ping or maybe better yet nslookup. I would like to launch and then capture all the output , redirect it I guess to a string variable or something. I know how to start it , but not how to capture it. Nslookup I realize can be started interactively, which is to some degree what I may need to do as I am discovering that there is no easy way to query DNS svr records with...
5
1735
by: goje | last post by:
Hello I want to capture the Output of the External Console Application in my application and also want to send commands to External Console Application from my application. Someone have some code for me? Please....Help me Goje
5
3155
by: vasilis | last post by:
I have a list box in a site with which I capture a selected value with the onChange event using the capture_value() function (code listed below). This function passes 2 arguments, i.e., 'str' which is the selected list box value and 'passed_url' which is a passed url for running a php script (which contains some url query parameters, e.g. 'somescript.php?var1=value1&var2=value2&var3=value3'). The capture_value() function actually sends a...
0
8851
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8747
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8528
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8627
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6179
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5649
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4175
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4335
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1737
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.