Program Rely On Other Files

If you need help with a project or need to know how to do something specific in VB.NET then please ask your questions in here.
Forum rules
Please LOCK your topics once you have found the solution to your question so we know you no longer require help with your query.
3 posts Page 1 of 1
Contributors
User avatar
mikethedj4
VIP - Site Partner
VIP - Site Partner
Posts: 2592
Joined: Thu Mar 25, 2010 4:36 am

Program Rely On Other Files
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.
User avatar
CodenStuff
Site Admin
Site Admin
Posts: 4392
Joined: Tue Aug 04, 2009 1:47 am

Re: Program Rely On Other Files
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 all
My.Computer.FileSystem.DirectoryExists(Application.StartupPath & "\Images")
Or if you wanted to place an image from the folder into a picturebox for example:
Code: Select all
PictureBox1.Image = Image.FromFile (Application.StartupPath & "\Images\SomeImage.jpg")
Welcome to CodenStuff.com Learn Code, Love Code. Thank you for being a member of the community.
User avatar
mikethedj4
VIP - Site Partner
VIP - Site Partner
Posts: 2592
Joined: Thu Mar 25, 2010 4:36 am

Re: Program Rely On Other Files
mikethedj4
Thanks it works bro!!!
3 posts Page 1 of 1
Return to “Coding Help & Support”