Folder empty

  • Thread starter Thread starter Luigi Z
  • Start date Start date
L

Luigi Z

Hi all,
using C# 2.0, how can I see if a folder is empty? (i.e. without any file
inside it).

Thanks in advance.
 
Paul said:
Use Directory.GetFiles to retrieve an array of filenames, and check whether
the Length is zero.

It may be a good idea to consider whether the presence of sub
directories would make it "non empty".

Arne
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top