![]() |
|
|
|||||||
![]() |
ASP Net - Problem in getting files in a directory |
|
|
Thread Tools | Search this Thread |
|
|
#1 |
|
Hi,
We are getting "Out of Memory" exception while using Directory.GetFiles() method if there are large number of files present in the directory on which the method is being executed. We would like to have an alternate solution for picking files from the directory, like picking only 10 or 15 files at a time. Is there anything in GetFiles() method with which we can tweak in its functionality to pick only a certain number of files? Or if there's an alternate solution for the same, please do let us know. Thanks, Hemant Hemant |
|
|
|
|
#2 |
|
Posts: n/a
|
"Hemant" <> wrote in news:eUwLlzuXKHA.1372
@TK2MSFTNGP02.phx.gbl: > Is there anything in GetFiles() method with which we can tweak in its > functionality to pick only a certain number of files? Or if there's an > alternate solution for the same, please do let us know. Are you using Directory or DirectoryInfo. the info classes are much less weighty. I am not sure this will solve the problem, as both should just get the names. In the 4.0 Framework, there are more efficient file manipulation methods, but that means heading into a beta to get your answer. There is a "Go Live" on beta 2, but it is still beta. Peace and Grace, -- Gregory A. Beamer Vote for Miranda's Christmas Story http://tinyurl.com/mirandabelieve Twitter: @gbworld Blog: http://gregorybeamer.spaces.live.com ******************************************* | Think outside the box! | ******************************************* Gregory A. Beamer |
|
|
|
#3 |
|
Posts: n/a
|
Hi,
Actually, in our case, its more than 5000 files that client puts in the directory and after that our windows service picks up those files to process. Also, the search criteria filter does not help much because the filenames are almost similar i.e. starting with same letters/words. Is there any other option that we can use to avoid this memory issue? thanks, Hemant "Mark Rae [MVP]" <> wrote in message news:... > "Hemant" <> wrote in message > news:... > >> We are getting "Out of Memory" exception while using Directory.GetFiles() >> method if there are large number of files present in the directory on >> which the method is being executed. >> >> We would like to have an alternate solution for picking files from the >> directory, like picking only 10 or 15 files at a time. > > There isn't anything like the equivalent of the command line /p switch... > > However, have you tried using filters to grab all of the files beginning > with 'A', and then all of the files beginning with 'B', etc...? > > > -- > Mark Rae > ASP.NET MVP > http://www.markrae.net Hemant |
|
![]() |
| Thread Tools | Search this Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Temporary Internet Files directory | Bluuuue Rajah | Computer Support | 16 | 10-21-2008 12:33 PM |
| Having problem downloading big files !! Help !!! | hsyq8xg@gmail.com | Computer Support | 0 | 04-19-2008 10:44 PM |
| undo for scandisk? it trashed my files. | NewB | Computer Support | 1 | 11-29-2006 09:08 AM |
| Re: Pen Drive Problem Reading Files | Kadaitcha Man | Computer Information | 2 | 01-25-2005 10:48 PM |
| opening shared files problem | Li'l Roberto | Wireless Networking | 0 | 07-02-2004 04:05 AM |