How can I control the folder for changes in the background of a Windows application?

I am writing a Windows 8 application that will run in the background. This application will be specific to computers (i.e. No tablets or phones, if that matters). He should be able to view the specified folder during its operation in the background and receive notifications that there are changes in this folder. Since this is a Windows Store app, I cannot use FileSystemWatcher , which would be ideal in my situation. In addition, I can not use the timer to view the folder, because these changes will occur every 10-15 seconds, and the timer does not support time less than 15 minutes. What other options do I have?

+6
source share
2 answers

Since you cannot use a timer that fires every 15 seconds or so, the only thing I can recommend is to start a simple cycle that before the cycle checks the system time from the system clock, and then with each cycle it checks the difference between the current system hours and originally saved value. When you get to 15 seconds, the loop will stop and run the code checking the folder. If the code in the loop is simple and uses the Sleep call, it should not accept almost any system resources.

Hope this helps you!

+1
source

Have you looked at the Windows Apps Background tasks? There is a question here: Windows 8 Live Tile Background Agent using C #

+1
source

All Articles