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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Load all files in a folder 1

Status
Not open for further replies.

ToshTrent

Technical User
Jul 27, 2003
209
Hi,

I have several folder with pictures in. I'm using the database primary key as the folder name to enable searching of the folders.

How can I locate the windows folder and load the pictures for that directory?

Thank you in advance!!!

[red]
Thankyou[/red]
Matt
 
What do you mean by "load"?
Do you just want a list of all files in the specified folder?

Sweep
...if it works dont mess with it
 
I want to load the image names into an array then call upon them when a user navigates though the application.

I need one image to be instantly displayed in a picture box. This method seems to have changed since vb 6 which is causing me a little confusion.

[red]
Thankyou[/red]
Matt
 
system.io.directory.getfiles

when you instantiate the directory object you can set the path.

a better function is the directoryinfo.getfiles which holds loads of information on each file using the fileinfo object

these methods will give you your array. As for loading them you can use the image.fromfile function for each item.
 
Thank you!

Could you possibly give me an example of the code I will need, I am running into a few problems.

[red]
Thankyou[/red]
Matt
 
The visual studio help files contains an example on how to use the method. If you don't have them installed, MSDN has an online version:


--------------------------------------------------------------------------------------------------------------------------------------------

Need help finding an answer?

Try the search facility ( or read FAQ222-2244 on how to get better results.
 
Result!

Thank you ever so much!

[red]
Thankyou[/red]
Matt
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top