Drew Taylor

Drew Taylor

  • NA
  • 70
  • 0

Reading files of all types

Jun 15 2007 6:02 AM

I want to be able to read .log files, I can specify the type of file to be returned but it breaks and can't open the file even though it contains plain text! Why is this?


Answers (3)

0
Alan

Alan

  • 0
  • 5.8k
  • 0
Jun 15 2007 10:24 AM
I don't think that will help, Drew, because the .log file will be copied in the state that it was in when it was last opened and will not include any subsequent additions.
0
Drew Taylor

Drew Taylor

  • 0
  • 70
  • 0
Jun 15 2007 8:12 AM

Yes I saw the error message, what about when the user clicks the button it makes a copy of the log file and then reads that one? And then I could have another button called refresh which copys and opens the copied file again?

0
Alan

Alan

  • 0
  • 5.8k
  • 0
Jun 15 2007 6:29 AM

If the .log file is currently in use by your application, or by some other process, then it'll need to be closed first before it can be reopened and read via a StreamReader.