Page 1 of 1
Program Rely On Other Files
Posted: Thu Apr 22, 2010 8:08 pm
by mikethedj4
ok this is one this I was wondering how to do, have a folder called images, and in that folder have the programs images in there like the splash screen = splash.png and so on. The folder before that would be the name of the program, and the programs .exe file in there to run it.
Re: Program Rely On Other Files
Posted: Thu Apr 22, 2010 9:43 pm
by CodenStuff
Hello,
You can use "Application.StartupPath" to check for folders in the same location as your application. For example if you wanted to check if a folder called "Images" exists in the same folder as your application you can use:
Code: Select allMy.Computer.FileSystem.DirectoryExists(Application.StartupPath & "\Images")
Or if you wanted to place an image from the folder into a picturebox for example:
Code: Select allPictureBox1.Image = Image.FromFile (Application.StartupPath & "\Images\SomeImage.jpg")
Re: Program Rely On Other Files
Posted: Thu Apr 22, 2010 10:30 pm
by mikethedj4
Thanks it works bro!!!