944,146 Members | Top Members by Rank

Ad:
  • C# Discussion Thread
  • Marked Solved
  • Views: 1068
  • C# RSS
Dec 6th, 2007
0

Monitoring a directory for changes - VS C# EE 2008

Expand Post »
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
Reputation Points: 10
Solved Threads: 3
Junior Poster
Barefootsanders is offline Offline
165 posts
since Oct 2006
Dec 6th, 2007
0

Re: Monitoring a directory for changes - VS C# EE 2008

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.
Featured Poster
Reputation Points: 975
Solved Threads: 140
Posting Virtuoso
scru is offline Offline
1,624 posts
since Feb 2007
Dec 6th, 2007
0

Re: Monitoring a directory for changes - VS C# EE 2008

Thanks for the help. I searched FileSystemWatcher and found just what I need. Thanks again!
Reputation Points: 10
Solved Threads: 3
Junior Poster
Barefootsanders is offline Offline
165 posts
since Oct 2006

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C# Forum Timeline: What event will capture DataGridView exception?
Next Thread in C# Forum Timeline: Graphical Barcode Control





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC