Monitoring a directory for changes - VS C# EE 2008

Please support our C# advertiser: Intel Parallel Studio Home
Thread Solved

Join Date: Oct 2006
Posts: 164
Reputation: Barefootsanders is an unknown quantity at this point 
Solved Threads: 3
Barefootsanders Barefootsanders is offline Offline
Junior Poster

Monitoring a directory for changes - VS C# EE 2008

 
0
  #1
Dec 6th, 2007
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
Reply With Quote Quick reply to this message  
Join Date: Feb 2007
Posts: 1,613
Reputation: scru has a spectacular aura about scru has a spectacular aura about 
Solved Threads: 130
Featured Poster
scru's Avatar
scru scru is offline Offline
Posting Virtuoso

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

 
0
  #2
Dec 6th, 2007
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.
Reply With Quote Quick reply to this message  
Join Date: Oct 2006
Posts: 164
Reputation: Barefootsanders is an unknown quantity at this point 
Solved Threads: 3
Barefootsanders Barefootsanders is offline Offline
Junior Poster

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

 
0
  #3
Dec 6th, 2007
Thanks for the help. I searched FileSystemWatcher and found just what I need. Thanks again!
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:



Other Threads in the C# Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC