|
-
Apr 14th, 2000, 05:35 PM
#1
Thread Starter
Hyperactive Member
Hi,
I would like to know how to scan the hard drive for any JPG files and then store them in a array of strings for example:
1) "C:\windows\setup.jpg"
2) "C:\images\frog.jpg"
Does anybody out there have a clue as to how I would go about doing something like this?
Thanks!
-
Apr 15th, 2000, 12:18 AM
#2
Addicted Member
Check out the tip "How to find files using Windows API" at:
http://www.vb-world.net/tips/tip59.html
It uses API calls to do a recursive directory search. I've used some of the code in several of my apps and it works great. Strip the recursive search code from the demo project and supply the search parameters you need from your own user interface or code.
-
Apr 15th, 2000, 12:28 AM
#3
Registered User
Guys,
I think there is no need for using the API functions.
If I'm not mistaken Microsoft has included a project in their \SAMPLES directory, which searches the HD for any file-types you want.
Just Check The \SAMPLES Directory.
Lior, An Israeli Programmer.
-
Apr 15th, 2000, 12:56 AM
#4
Addicted Member
I don't have the sample programs installed (conserving hard disk space ), so I'll have to take Lior's word on it.
However, if the sample program uses the "DIR" function to do a recursive search you will find that the speed is pretty poor compared to the API version given in the VB World Tip.
As for me... I'm a fan of using API calls when they are available. They usually perform better and I want my apps to be as efficient as possible.
-
Apr 15th, 2000, 02:07 AM
#5
Registered User
Well...
As far as I know, the sample uses neither the DIR build-in function, nor any API function.
If you know the Turbo Pascal language, It uses something close to the FindFirst & FindNext procedures.
Lior, An Israeli Programmer.
-
Apr 15th, 2000, 03:00 PM
#6
Thread Starter
Hyperactive Member
Thank you both for your help. I'm also a fan of API functions.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|