user2443476
user2443476

Reputation: 1975

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.

Upvotes: 0

Views: 111

Answers (1)

SLaks
SLaks

Reputation: 887255

You're looking for Directory.EnumerateFiles().

Upvotes: 1

Related Questions