views:

109

answers:

2

Hi there, I'm using C# for a mini project of mine, I am trying to monitor files that are changed, Deleted, And/or created. And export that to a file. But I am not quite sure how to monitor files. Any ideas?

+5  A: 

You can use the FileSystemWatcher class to monitor file creation, modifications, deletions and renames.

You have the following events available:

CMS
A: 

Yep, FileSystemWatcher will do this. Be careful what you wish for, because this thing watches everything!

Have a look here, it explains how you it can fire multiple events (eg when a file is moved, firing an OnChange and OnCreate

Christian Payne