?
Solved

Getting files from a folder.

Posted on 2011-10-18
4
Medium Priority
?
226 Views
Last Modified: 2012-05-12
Hi all,

I’ve got a folder where I want to grab just one file at a time.
The trouble is the folder has thousands of files in and when I use GetFile it grabs all the files for each time I want to get just 1.

What’s the best way of doing this ?

Thanks in advance,
K.
0
Comment
Question by:Kinger247
4 Comments
 
LVL 28

Accepted Solution

by:
strickdd earned 500 total points
ID: 36986343
Unless you know the name of each file, you can't just pull one. However, the "GetFiles()" method will only get a string array of all the file names from which you can load a file object.

If you can provide a bit more detail as to what you are trying to do, there may be a better way.
0
 
LVL 20

Assisted Solution

by:ElrondCT
ElrondCT earned 500 total points
ID: 36990390
How do you know what one file you want to get? What do you want to do with it?
0
 
LVL 4

Assisted Solution

by:Ambusy
Ambusy earned 500 total points
ID: 36992200
I'd remove the ARCHIVE attribute from all files (ATTRIB -A *.*).
Then pick the first file from your GetFile list that has the archive bit off (Fileinfo), do something with it (you know what, I don't), and then put the archive bit on. This way you will in the end process all files, one by one.
0
 
LVL 14

Assisted Solution

by:nishant joshi
nishant joshi earned 500 total points
ID: 37000285
which type of file you want to get what was the extension and what about filename.....
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article introduced a TextBox that supports transparent background.   Introduction TextBox is the most widely used control component in GUI design. Most GUI controls do not support transparent background and more or less do not have the…
High user turnover can cause old/redundant user data to consume valuable space. UserResourceCleanup was developed to address this by automatically deleting user folders when the user account is deleted.
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Suggested Courses

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question