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

Capturing Console Output....

I have a group of objects that I want to be able to echo information (Console.writeline in the NEw(), Add(), etc). The objects will
be used in a service and in my test application (Winform).

Would it be best to capture the std output and echo the information there? And if I did this, HOW do I do it? Any good articles
on this? Would just raising events be better (Kinda would prefer to not do this)?

Thanks
Scott
Nov 21 '05 #1
3 1769
In article <em**************@TK2MSFTNGP11.phx.gbl>, Scott Meddows wrote:
I have a group of objects that I want to be able to echo information (Console.writeline in the NEw(), Add(), etc). The objects will
be used in a service and in my test application (Winform).

Would it be best to capture the std output and echo the information there? And if I did this, HOW do I do it? Any good articles
on this? Would just raising events be better (Kinda would prefer to not do this)?

Thanks
Scott


Scott, you may want to look into the System.Diagnostics.TraceListner
class. Using tacelistners, you can provide debug infromation to
serveral different sources, or even provide custom listners. You can
also turn them on and off at runtime using config file settings...
--
Tom Shelton [MVP]
Nov 21 '05 #2
Hi,

Use the process class to do that.
Dim pi As New ProcessStartInfo

Dim p As Process

pi.RedirectStandardOutput = True

pi.FileName = "c:\myconsoleapp.exe"

pi.UseShellExecute = False

Dim sw As New System.IO.StreamWriter("C:\MyOutPut.txt")

p = Process.Start(pi)

sw.WriteLine(p.StandardOutput.ReadToEnd)

p.WaitForExit()

sw.Close()

Ken

------------------------------------

"Scott Meddows" <sc******************@tsged-removeme.com> wrote in message
news:em**************@TK2MSFTNGP11.phx.gbl...
I have a group of objects that I want to be able to echo information
(Console.writeline in the NEw(), Add(), etc). The objects will
be used in a service and in my test application (Winform).

Would it be best to capture the std output and echo the information there?
And if I did this, HOW do I do it? Any good articles
on this? Would just raising events be better (Kinda would prefer to not do
this)?

Thanks
Scott

Nov 21 '05 #3
AWESOME!!!!!
Man, I love the .Net framework. That was so easy!!!!

Thanks a lot!

"Tom Shelton" <to*@YOUKNOWTHEDRILLmtogden.com> wrote in message news:Oa**************@tk2msftngp13.phx.gbl...
In article <em**************@TK2MSFTNGP11.phx.gbl>, Scott Meddows wrote:
I have a group of objects that I want to be able to echo information (Console.writeline in the NEw(), Add(), etc). The objects
will
be used in a service and in my test application (Winform).

Would it be best to capture the std output and echo the information there? And if I did this, HOW do I do it? Any good
articles
on this? Would just raising events be better (Kinda would prefer to not do this)?

Thanks
Scott


Scott, you may want to look into the System.Diagnostics.TraceListner
class. Using tacelistners, you can provide debug infromation to
serveral different sources, or even provide custom listners. You can
also turn them on and off at runtime using config file settings...
--
Tom Shelton [MVP]

Nov 21 '05 #4

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

Similar topics

5
by: Moosebumps | last post by:
I have a large set of Python scripts that interface with command line utilities (primarily Perforce). I am currently capturing ALL the text output in order to get results and such. I am using the...
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...
0
by: D. Bron | last post by:
Group, Is there any way to capture System.Console.Out output in the IDE? as it stands, anything that gets printed to the console is lost once the application exits. -D. Bron
2
by: Harikumar G | last post by:
Friends, I have a C# console application for verifying a signature of an encrypted, this is done thru the Process.Startinfo method, My dos application for the decryption is gpg.exe (gnupgi) ...
2
by: Carsten Klotz | last post by:
Hi, does someone know, if it's possible capturing the content of a panel, when its form has state "minimized"? Details: A panel contains a Webbrowser object (AxSHDocVw.AxWebBrowser). My...
3
by: iforsyth | last post by:
Hi. Running an app with System.Diagnostics.Process process with: Sample code: myproc = New System.Diagnostics.Process() strPgm = "myapp.exe" strArgs = "" myproc.StartInfo = New
6
by: Ed Leafe | last post by:
I've been approached by a local business that has been advised that they need to start capturing and archiving their instant messaging in order to comply with Sarbanes-Oxley. The company is largely...
2
by: jallam | last post by:
Hi, I have a Python script to upload the Invoice data which is in .csv file to OTM (GLOG) system. I'm running this script using the command(given below) using a shell script and capturing the...
3
by: mohanprasadgutta | last post by:
Hello, I want to capture the text being printed on console. problem description is as follows. I am calling called.pl program from caller.pl program using backticks. in called.pl program i am...
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: 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...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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: 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...

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.