redirect output

  • Thread starter Thread starter bonzo
  • Start date Start date
B

bonzo

Hi, I have one external executable file that opens a file output.txt and
writes something to that file. I need to catch anything that goes to
that file and save it to a string object.
I suppose i should make something like a ramdisk, but it's too
complicated. I'd like to do something more simple but haven't found
anything useful on the web. pls help.

Thank you

Libor
 
Thank that helps, but what i didn't say is that i want to redirect the
output. Not only see what it writes to the output but forbit the
external file to write to the file and catch the text to my object...
But this helped me a lot, thank you very much

Libor
 
you can use System.IO.FileSystemWatcher events to catch when file is
changed and just revert changes just after external exe change it.

be careful with this as easily you could prevent changing file if you
do not check for process which change file.

FYI: you can get initial content on your app constructor and change it
each time when non-target exe changes the file

hope this helps
Galin Iliev[MCSD.NET]
www.galcho.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top