Trying to find the path where my program is installed
Hi guys. I'm making a program that has a text file and a configuration file that are stored in my programs installation path, but I am having difficulties setting a variable to the path my program is currently installed to, where my Readme.txt and config file will be. I need this path in a variable so I can use it to read these files. It's gotta be some variation on a GetDirectory like method. Does anyone have an idea how I can do this? For some reason, I just can't find the info I need and I'm new to VB (Though I am moderately skilled with C++) Thanks.
Re: Trying to find the path where my program is installed
Application.StartupPath (which would make jmcilhinny cringe)
or
| DataDirectory |
Re: Trying to find the path where my program is installed
use the following...
Code:
Dim strPath as string=Application.StartupPath.ToString
Re: Trying to find the path where my program is installed
Application.StartupPath returns a string so there is no need to call the ToString method at the end.
Re: Trying to find the path where my program is installed
Thank you so much for the help, you guys. I should have guessed that it was in the application class. Have a wonderful day and happy coding, my friends!