|
|
#1 |
|
New Member
Join Date: Mar 07
Posts: 5
![]() |
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.
|
|
|
|
|
|
#2 |
|
Fanatic Member
Join Date: Sep 06
Location: Wichita, KS
Posts: 836
![]() |
Re: Trying to find the path where my program is installed
Application.StartupPath (which would make jmcilhinny cringe)
or | DataDirectory |
__________________
Visual Studio 2003 Enterprise Developer | Visual Studio 2005 Professional | Securing Connection Strings | My.Settings | VB @ The Movies | DataSets | Using SQL in MS Access I have seen the enemy, and he is us. If your problem has been solved, don't forget to mark the thread "RESOLVED" by using the Thread Tools at the top right of your first post. Everyone likes to get reputation points. So if someone helped you out, give'em an At-A-Boy by clicking on the scales next to their name.
|
|
|
|
|
|
#3 |
|
Hyperactive Member
Join Date: Aug 05
Location: Lancashire UK
Posts: 362
![]() |
Re: Trying to find the path where my program is installed
use the following...
Code:
Dim strPath as string=Application.StartupPath.ToString
__________________
If my post helps , please feel free to rate it
|
|
|
|
|
|
#4 |
|
Fanatic Member
Join Date: Sep 06
Location: Wichita, KS
Posts: 836
![]() |
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.
__________________
Visual Studio 2003 Enterprise Developer | Visual Studio 2005 Professional | Securing Connection Strings | My.Settings | VB @ The Movies | DataSets | Using SQL in MS Access I have seen the enemy, and he is us. If your problem has been solved, don't forget to mark the thread "RESOLVED" by using the Thread Tools at the top right of your first post. Everyone likes to get reputation points. So if someone helped you out, give'em an At-A-Boy by clicking on the scales next to their name.
|
|
|
|
|
|
#5 |
|
New Member
Join Date: Mar 07
Posts: 5
![]() |
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!
|
|
|
|
![]() |
|
||||||
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|