开发者

What causes a FileSystemWatcher object to go stale?

开发者 https://www.devze.com 2022-12-18 17:19 出处:网络
I have a FileSystemWatcher that processes files based on file system events.After awhile, the process is still alive, but it no longer detects the file system events.The process watches开发者_C百科 a

I have a FileSystemWatcher that processes files based on file system events. After awhile, the process is still alive, but it no longer detects the file system events. The process watches开发者_C百科 a local network share drive.

Anything I should be watching out for?


Most likely small drops in network connectivity. Check this article.

Basically:

  • set watcher.EnableRaisingEvents = true
  • add an event handler to watcher.Error

Then re-bind on error.


I guess I better post the answer instead of leaving it in the comment: did you implement the Error event? When you do get errors, bump up the value of the InternalBufferSize property. Try 16384.


http://bytes.com/topic/visual-basic-net/answers/536125-filesystemwatcher-across-network

0

精彩评论

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