C #: how to check if an open file is updated

You know this function, for example, you opened it C:\test.txt, if you also have the same file in another editor, and you edit it there, when you return, the application will offer to change the file if you want to update it. How to check if a file is updated?

UPDATE

Asked about a sister Using FileSystemWatcher to view changes to files "

+3
source share
3 answers

You can use FileSystemWatcher to receive notifications from the file system.

+9
source
+4

FileSystemWatcher, .

, FileSystemWatcher , IDisposable. ( ). , , FileInfo , FileInfo.Refresh, FileInfo. API File.

, FileSystemWatcher . FileSystemWatcher .

+4

Source: https://habr.com/ru/post/1770280/


All Articles