FileSystemWatcher - How find out type (directory / file)

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

Here is another newbie question:

I am using the FileSystemWatcher. The filter I have set to "*.*". On the events, I get a FileSystemEventArgs object where I can get i.e. the name of the created/deleted/changed/renamed file or folder. But how do I find out first, if the object is a file or a directory?

Any hints are greatly appreciated.

Greets,

Phil
 
Hi Phil,

You can do this: Directory.Exists (e.FullPath) , if this returns true that
means you have created/deleted/changed/renamed a folder, and if it returns
false you have a file.

Hope this helps.
 
Back
Top