Search code examples
c#filesystemwatcher

detecting file changes in folder when program is not running


I checked that the folder that's watched by FileSystemWatcher actually does not check or tells the changes in the folder while the program is not running. How can I check the changes in the folder when the program is off? I mean, how can the program tell 'the changes in the folder when the program is off'?


Solution

  • If you want to know that the changes have happened when they happen, you'll need to use a service (see here: https://learn.microsoft.com/en-us/dotnet/framework/windows-services/introduction-to-windows-service-applications).