I would like to know, if there is a native way, (like a variable of the FileSystemWatcher class), to get a list of all the files presents in the directory watched by the FileSystemWatcher once started. The watcher can raise events when a file is modified, deleted,..., but is it able to get the name of all the files of the directory it is watching once it begins his surveillance, without necessarily having a specified event.
您正在寻找Directory.EnumerateFiles()
。
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.