开发者

Need to open file I log to but get file locked exception

开发者 https://www.devze.com 2023-02-22 04:10 出处:网络
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

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消