What is the fastest way to get a total of the files on a given drive using C#? I have been thinking about using a seperate thread, but I would have to wait too long for it to count every file. Is there a faster way than counting each file one by one?

Hi,

Short answer, "no, there isn't". Long answer, you might consider using Indexing Service of 2000/XP or if you can access FAT of FAT or MFT of NTFS you might process that data structure.

Loren Soth

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.