C# Directory Monitoring

Posted on 2011-09-06
Last Modified: 2012-05-12
I need to monitor a directory for changes to files and directories. Ideally i wish to be able to see who has made the changes.

I have been looking at the C# File System Watcher, and that looks good, but i cannot see how i can get the user information? Anyone have any ideas if this is possible to be able to obtain the username of some making changes to a folder or file in C#?
Question by:alnunn
  • 5
  • 2
LVL 22

Accepted Solution

plusone3055 earned 250 total points
ID: 36490656
only way that can be done is if the  user list information is stored in the folder and the folder itself was an application

you can use it to determine WHAT was changed but not by who with just that class
LVL 22

Expert Comment

ID: 36490672

Author Comment

ID: 36490710
I tought this might be the case. Without creating some standalone application, Is there some library that can be used to maybe assist with this? No way to tie in with process monitoring or something like that?
LVL 22

Expert Comment

ID: 36490728
hate to be the bearer but as i said before unless the folder was an application itself with the user database in it you cannot determine on a machine what user last modified a folder

I monitor changes to projects in databases all day only way it can be done is with a database :(

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

LVL 12

Assisted Solution

rajapandian_81 earned 250 total points
ID: 36494758

Try File Sight Pro:
LVL 22

Expert Comment

ID: 36495232
as Rajapandin confirmed thats an entire Application
as I have originally stated thats the only possible way

Author Comment

ID: 36497705
I'm still unconvinced... That application doesnt appear to store files within an application. It is monitoring a directory, and logging the usage data to a database.

If this application can do what i want to do, i cannot believe there is not an easy enough way of doing this. However, for $199 i'd be inclined to look at that rather than looking at how to code something.
LVL 22

Expert Comment

ID: 36504329
its not a question of storing files.. Its a question of storing user information...

heres an example

you have a a work machine that has a requires a password
10 people know this password

I go in and change a folder at 2pm and change the folder
person number 2 goes in and changes the folder 5 min later
you go in and it says last changed @ 2:05pm

How is it supposed to know who logged in last when were all using the same password to access the machine ???

Answer is it wont beucase there is nothing to unique identify who has logged onto the machine and that particular folder...

No one is trying to trick you.. there just is not a simple way...


Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Extention Methods in C# 3.0 by Ivo Stoykov C# 3.0 offers extension methods. They allow extending existing classes without changing the class's source code or relying on inheritance. These are static methods invoked as instance method. This…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Internet Business Fax to Email Made Easy - With eFax Corporate (, you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now