Search code examples
c#.netwindowsfilentfs

How to monitor Fileaccess in C#


i want to detect changes in filesystem for a special directory and i heard that is possible to monitor the file-access. Can anyone tell me how to monitor a directory for example in C#.NET?

THX Rene


Solution

  • You need the FileSystemWatcher.

    Full documentation on MSDN is here: http://msdn.microsoft.com/en-us/library/system.io.filesystemwatcher.aspx