folder path?

thejeraldo

Well-known member
Joined
Jun 9, 2009
Messages
70
Location
Philippines
Programming Experience
1-3
hey guys, i added a folder in my project by using the solution explorer. now i want to include a couple of images there that i can use as a default image for my app. in my app i have a picture box which will:
show a 'default pic' if the person doesnt have a picture yet.
show an 'error pic' if the picture is not found.
show the persons image located in the server.

i want to put the default and error pic in a local folder in my app. if the Images folder will be included if the app is deployed or installed. how should i get the path of the images stored in that folder?

thanks.
 
Application.StartupPath gives you the path of the folder containing the EXE so you can just append the folder name to that.

That said, are you sure that's the way you want to go? If you leave those image files loose then they can be replaced, renamed or deleted. If that's what you want then that's what you should do but, if you don't intend those images to change, a better idea would be to embed them in your app as resources. You would that on the Resources page of the project properties and you'd then access the Images using My.Resources.
 
well, the default pics that will be show if the person doesnt have a picture yet will be in the proj resource so that if i install my app it would be there locally.

thanks.

any uploaded picture of a person will be stored in a folder in the server. one person can only have one so and whenever a picture is uploaded for a person the filename will just be changed according to the persons systemID.

do you think it will run slow if the images are retrieved and saved into the server over a local network?
 
ok i just recently tested that if the path of the image that is stored to my database and used for imagelocation of my picturebox is over a password protected network/server the app would show an error image in the picturebox. then ive accessed the folder using windows explorer and ran the app again then its OK.

any suggestion solving this? i think i have an option to:
1. store the image storage folder on a non password protected server (which i think is very unsecured and inadvisable)

OR

2. put something of like a code that will allow the app to enter the password protected server/folder over the network.

any help/reply appreciated. thanks.
 
Back
Top