FileSystemWatcher class allows to get notification on any change in the directory. The notification can be even filtered by changes like rename, delete and all. File types can be specified to the class to allow notification for a particular file types.
The file watcher is implemented using the WCF Callback function. Whenever any change in the specified directory an event is triggered and a callback function is called. The WCF client program will listen to the callback function and update the control. For sample program the changes are formed as XML string and returned in the callback. When the callback function is called the xml is updated to the rich text control of the forms client.
The WCF service is implemented using the NetTcp binding. The attached file contains the WCF service library and the Console Host for the service. The second attachment contains the form client to get the notification. The samples are in VB code
Download the Source code from below links…