954,549 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Monitoring a directory for changes - VS C# EE 2008

Hey everyone,

I'm attempting to monitor a directory, including subdirectories, for changes and update a database. The database part I can do, I just cant figure out how to monitor the directory for changes.. any suggestions? Is there an easy way to do it like function.getChanges(directory)?? Microsoft seems to make things way to easy like that sometimes and maybe I'm just missing it.

Thanks,
barefoot

Barefootsanders
Junior Poster
166 posts since Oct 2006
Reputation Points: 10
Solved Threads: 3
 

You are quite right. There is a control called FileSystemWatcher that you can use. Unfortunately, this computer only has Visual C++ installed, so I can't really give you an example in C# (having never used the control before).

I'm not sure about the control's availability for WPF applications, but it i definitely there for Windows Forms.

scru
Posting Virtuoso
1,629 posts since Feb 2007
Reputation Points: 975
Solved Threads: 140
 

Thanks for the help. I searched FileSystemWatcher and found just what I need. Thanks again!

Barefootsanders
Junior Poster
166 posts since Oct 2006
Reputation Points: 10
Solved Threads: 3
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You