I'm seeking for help with storing and retrieving/calling numerous sound and picture files. I've about 200 both .bmp and .wav files and it might get bigger. So I'm not sure if it's wise to embed that many files in the Resources, or should I add them to a special directory within my project and call them from there or else. VB 2005 does not recognize just a file's name even if it is located it the Resources so my question is how can I call file using just its name and not full path? And if I have to store my files in the special folder, I should propably search for that specific folder in the runtime and I need help with this one too. Thanks in advance.
slowburner
0
Newbie Poster
Recommended Answers
Jump to PostHi,
If the file is in a subfolder of your project then you can call it using its full path
Dim FilenameAndPath as String FilenameAndPath = My.Application.Info.DirectoryPath & "\Images\Picture001.bmp" PictureBox.ImageLocation = FilenameAndPath 'or FilenameAndPath = My.Application.Info.DirectoryPath & "\Audio\Sound001.wav" My.Computer.Audio.Play(FilenameAndPath)
Jump to PostThe best way i have found to deploy images, sound and other types of files is to place them in your "Resources" folder and then select the file in "solution Explorer" and change the property "Copy to Output Directory" to "Copy always"
This will copy your images and other …
All 5 Replies
ptaylor965
6
Junior Poster
slowburner
0
Newbie Poster
ptaylor965
6
Junior Poster
Kruedog
0
Newbie Poster
ptaylor965
6
Junior Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.