简体   繁体   中英

FileSystemWatcher Events in IDE

FileSystemWatcher provide us different kind of events from changed to deleted. I was wondering why I'm getting deleted event whenever I used visual studio 2005 to edit a file and changed event if I'm using notepad or notepad++ and other editor?

Standard operation for programs that want to avoid losing everything:

  1. Rename original file
  2. Create new file with original name
  3. Write and close file
  4. No problems: delete file from step 1

If something goes wrong, the renamed file is restored. Your other editor would corrupt the original if something goes wrong while writing.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM