-
Dec 15th, 2017, 01:14 PM
#1
Thread Starter
Junior Member
Storing Images alongside ID
Hi !
I am using text files to store my userID's as I am only allowed to do it this way as part of our high school assignment. However I would also like to store images alongside each ID. How can I do this I am struggling with this any ideas ?
-
Dec 15th, 2017, 01:32 PM
#2
Re: Storing Images alongside ID
Put them in to a sub folder "photos" and rename them with the ID (assuming the ID is a valid filename format).
-tg
-
Dec 15th, 2017, 01:57 PM
#3
Thread Starter
Junior Member
Re: Storing Images alongside ID
How would i match the ID with the image though, still confused
-
Dec 15th, 2017, 02:21 PM
#4
Re: Storing Images alongside ID
It's hard to give accurate advice without knowing the kind of data you have, but assuming that your data includes an ID number like 37, save the picture file with a name of 37 (eg: 37.jpg)
To load the picture you can detect which file(s) in the folder have the same name (using
Directory.GetFiles or similar), and assuming there is just one then display it (if there is more than one then it is debatable).
Last edited by si_the_geek; Dec 15th, 2017 at 02:24 PM.
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
|