Need to open file I log to but get file locked exception
hI,
I'm using LOG4NET to log to a txt file. However, one of my forms needs to open the txt file (using streamreader) to read the contents and display them in a .txt file. However, I keep getting an exception stating that the f开发者_开发知识库ile is locked by another process.
Is there a way around this in LOG4NET?
Thanks
This may be help you.
http://www.ericbt.com/Blog/48
If you open the log file with ReadWrite sharing enabled (FileShare.ReadWrite) it will probably work.
You can always uses Process Monitor from http://www.sysinternals.com to see what is happening.
精彩评论