![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Expert Programmer
|
Bind Console & log file
Hey Guys.
Just curious as it might save me some time. Does anyone know if there is a way (already built into the framework) to have everything that shows up in the console(System.Console) window be written to a text/log file? I'm looking for an easy way to bind it. Thanks. |
|
|
|
|
|
#2 |
|
Troll
Join Date: Apr 2005
Location: Texas
Posts: 732
Rep Power: 4
![]() |
If you want to do some fancy tricks such as having output appear in the console AND in the log...
http://msdn2.microsoft.com/en-us/lib...le.setout.aspx Otherwise, it would be just as effective to use program.exe > file to redirect standard output via your command shell.
__________________
MD5(sig) = bcef75433db02e9ad9bf81d6f7c5c270 |
|
|
|
|
|
#3 |
|
Caffeinated Neural Net
![]() Join Date: Jun 2005
Location: Dry west coast of Canada
Posts: 1,007
Rep Power: 5
![]() |
If you wish to display the output in the console window and redirect it to a file, you can take Dameon's suggestion a step further. Derive a new class from TextWriter or StreamWriter that has two private StreamWriter members (one of which is connected to the console, and the other to your file) and for the Write() method, provide an implementation that writes to both streams.
__________________
And once again, Probability proves itself willing to sneak into a back alley and service Drama as would a copper-piece harlot. - Vaarsuvius, Order of the Stick |
|
|
|
|
|
#4 |
|
Expert Programmer
|
Daemon I took a quick look at what you said and it seems to be working. I'm going out look into it more and post back. Just have to find the time. Thanks for the replies guys.
|
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| converting string to float | beginnerCCC | C | 22 | Oct 2nd, 2006 11:59 PM |
| OnlineTextEditor.Com! | Sane | Show Off Your Open Source Projects | 43 | Jun 16th, 2006 8:55 AM |
| After execution - Error cannot locate /Skin File? | wchar | Visual Basic | 1 | Mar 5th, 2005 9:04 PM |
| airport Log program using 3D linked List : problem reading from file | gemini_shooter | C++ | 0 | Mar 2nd, 2005 4:12 PM |
| Structure char field to a disk file | ehab_aziz2001 | C++ | 0 | Feb 10th, 2005 2:42 PM |