Hi,/P>
Yesterday I was playing around with some directories and a requirement came in where by I had to keep watch on the changes in the directory structure. My requirement was to update user as soon a there was a change in a file in the given directory. /P>
I first thought of many ways to do it. By the end I found it was pretty easy to be done. We have to use the FileSystemWatcher class in the System.IO to get the job done. /P>
Lets say we want a notification to be there when there is a change the D drive (D:\). If you want to also make the notification for sub directories then we need to set the IncludeSubdirectories to true. Here is a small code on how to use the component./P>
FileSystemWatcher watchFiles = new FileSystemWatcher(@"d:\\");/P>
watchFiles.IncludeSubdirectories = true;/P>
string dtCur = DateTime.Now.ToLongTimeString();/P>
Continued...