简体   繁体   中英

Access to names of all files of directory via FileSystemWatcher

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.

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