469,160 Members | 1,854 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,160 developers. It's quick & easy.

console application messages redirect

hey all,
i have a console application that uses the console to display message status
of my process. what's the best way (low impact) to get the messages as they
are now into an email?

thanks,
rodchar
Oct 22 '08 #1
1 1870
On Wed, 22 Oct 2008 07:11:02 -0700, rodchar
<ro*****@discussions.microsoft.comwrote:
hey all,
i have a console application that uses the console to display message
status
of my process. what's the best way (low impact) to get the messages as
they
are now into an email?
Redirect the output to a file and then send the file as email.

Depending on how you're trying to do this, you can accomplish it
programmatically. If you want to accomplish it from without the console
application, you can use the Process class to run your console
application, redirect the output and just write it to a memory data
structure (String, MemoryStream, whatever), and then use the Smtp class to
send the email.

If you want to accomplish it from within the console application itself,
then you might find that using Console.SetOut() to specify your own
TextWriter to write to a memory data structure as above, and then using
the Smtp class would work.

Pete
Oct 22 '08 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by A.M | last post: by
6 posts views Thread by Flip | last post: by
2 posts views Thread by Schorschi | last post: by
1 post views Thread by John Wright | last post: by
4 posts views Thread by =?Utf-8?B?RGF2aWQgVGhpZWxlbg==?= | last post: by
6 posts views Thread by drhilbert | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.