 Hi there, this is Krish Raj from White Scout and in this video we will be going to perform one demo of the file system watcher. Well, the file system watcher as its name suggests is a component class in .NET framework that continuously monitor your files or configured folders. You can define files or a whole directory to look after and have a custom action that notifies your every time those files or directory have been changed. So here we are creating a file system watcher object called a file system watcher and we pass in path of the directory which we want to monitor in the constructor of file system watcher class. And then we have set a filter in our case its star.txt which means here we want to monitor only .txt files and then I have set a notify filter of the file system that we are interested in being notified. For example, in our case, its file name, file size and file attribute. So here I am just creating a filter to notify us when there is a changes to the file name and file size and the attributes such as read only or he done. So we get notified of the changes by hooking up event handlers like change or created, deleted and rename events of the file system watcher. So for the first three events, we are just pointing to the same event handler because they have the same type of event arg and for the rename event, we are hooking this up to the on file rename occur method. And then we said this enable raising events to true and this will start monitoring and listening to this event handler methods. Now if we look at this method, we are just writing out the change type and the file name and in case of rename method, we are just writing out the old file name using this property and new file name using this property in the console. Now let's run this application and have a look at our directory that we are monitoring. Now let me create a new text file. Notice here in the console we have got our file changed event and the type of the file event is created and now let me rename this file. And this time you can see that we get our file rename event handler. So here we have our old file name and this is our new file name. And same way when I delete this file, we get the deleted event and the file name. Now let me recreate a new text file. And then let me open the property window of this file. Now in this attribute, if I change any of these two attributes, say for example, if I mark this file as read only and click on apply button, you can see that our change event is fire. And now if I uncheck this property and click on apply button, this file change event is again fired. So the file system watcher is a very handy class when you want to monitor the file system of specific directories and files.