how to Get All events of specific Folder from OS File system

Dear All,

How to Get All Event Happened in specific folder for ex(Delete Event, rename,last modified date) and its sub directory using OS File System

Thanks
wael_shehabAsked:
Who is Participating?
 
Lokesh B RDeveloperCommented:
Hi,

No.

You need to tell the FileSystemWatcher class to monitor the folder at some point. So you need either Windows Service/ Windows Forms/ Some Scheduler application to do this.

Since it doesn't know when to do the monitoring.
0
 
Lokesh B RDeveloperCommented:
Hi,

You can use FileSystemWatcher  Class to monitor all the events on any file/sub folders inside that.

Read more with example:
https://msdn.microsoft.com/en-us/library/system.io.filesystemwatcher(v=vs.110).aspx
0
 
wael_shehabAuthor Commented:
thank you for reply
but   i am working in web service application so how or where  can i call  this class,
Thanks
0
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
Lokesh B RDeveloperCommented:
Hi,

You can initiate the FileSystemWatcher object on the Folder where your web service in deployed and you can get the notifications and do the necessary things (logging to file).

Make sure the Folder is accessible from the service class.
0
 
wael_shehabAuthor Commented:
Thanks
but is there any way to do the same thing with out using exe program or windows From application
0
 
wael_shehabAuthor Commented:
Thank you
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.