Why are FileSystemWatcher Attribute changes detected on Windows 7 but not Windows 8?

后端 未结 5 1072
太阳男子
太阳男子 2020-12-14 06:31

I have some code that uses FileSystemWatcher to monitor file changes outside of my application.

On Windows 7, using .NET 4, the below code would detect when a file

5条回答
  •  温柔的废话
    2020-12-14 06:34

    I don't know why but I find that under Windows 8.1

    NotifyFilters.LastWrite (Changed event) of class FileSystemWatcher will fire

    • if I monitor directory inside my desktop(C:\Users\[user]\Desktop).

    the event will not fire

    • if I monitor program files directory (C:\Program Files (x86))

    May be related to permission but I don't know how to config it, both condition are run under administrator

提交回复
热议问题