Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Working with Files

Status
Not open for further replies.

gadafi

Programmer
Joined
Jan 17, 2005
Messages
3
Location
ES
Hi there:
I am developing an application that load photos from folderss. The problem is that I have a very big number of files in each directory, and I need to get the First and the Last file of each directory. I have tried to use FileInfo and Directory.GetFiles(). The problem is that it take a lot of time to return the FileInfo[]. Is there any method as C++ FindFirst or FindNext? Any idea about how to solve this problem?
Thanks ;)
 
There doesn't seem to be a way to do this via the .net framework. Ideally, you'd issue a BeginGetFiles call, and have it call you back via a delegate. But even the v2.0 framework doesn't seem to offer that ability.

You can write your own class to do this, wrappering the Win32 FindFirst and FindNext methods so they call you via a delegate. But I'm not sure you want to go to that much work.

CHip H.


____________________________________________________________________
Donate to Katrina relief:
If you want to get the best response to a question, please read FAQ222-2244 first
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top