Detecting file changes just like Visual Studio

  • Thread starter Thread starter desmcc
  • Start date Start date
D

desmcc

I want to mimic the functionality of Visual studio where if an opened
file is modified outside of the IDE, the user is prompted if they wish
to reload the file(s). What is the best approach to do this. I have
read different postings about the FileSystemWatcher class where there
seems to be plenty of problems and hacks required when using this class
(e.g. duplicate notifications) etc.
What should I use - FileSystemWatcher or some alternative ?

thanks,
Des.
 
Sorry... as I reread the post I see it's not a startingpoint you're looking
for. I've never used the FileSystemWatcher and wasn't aware that there were
any problems with it.

If you really want to go do it your own way, check out the Windows APIs
FindFirstChangeNotification and it's related functions.


Arild
 
The FileSystemWatcher works fine. I've never had any problems with it.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
If you push something hard enough,
it will fall over.
- Fudd's First Law of Opposition
 
Back
Top