To register for an Internet.com membership to receive newsletters and white papers, use the Register button ABOVE.
To participate in the message forums BELOW, click here
VBForums  

VB Wire News
MSDN Subscribers: Download the VS 2010 Release Candidate
MSDN Subscribers: Download the VS 2010 Release Candidate
Sell Your Code and Make Money?
Creating your own Tetris game using VB.NET
Article :: Improving Software Economics, Part 4 of 7: Top 10 Principles of Iterative Software Management



Go Back   VBForums > Visual Basic > Visual Basic .NET

Reply Post New Thread
 
Thread Tools Search this Thread Display Modes
Old Mar 9th, 2007, 12:02 PM   #1
gholin
New Member
 
Join Date: Mar 07
Posts: 5
gholin is an unknown quantity at this point (<10)
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.
gholin is offline   Reply With Quote
Old Mar 9th, 2007, 12:10 PM   #2
circuits2
Fanatic Member
 
circuits2's Avatar
 
Join Date: Sep 06
Location: Wichita, KS
Posts: 836
circuits2 will become famous soon enough (65+)
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.
circuits2 is offline   Reply With Quote
Old Mar 9th, 2007, 12:12 PM   #3
Tinbeard
Hyperactive Member
 
Join Date: Aug 05
Location: Lancashire UK
Posts: 362
Tinbeard will become famous soon enough (65+)
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
Tinbeard is offline   Reply With Quote
Old Mar 9th, 2007, 12:17 PM   #4
circuits2
Fanatic Member
 
circuits2's Avatar
 
Join Date: Sep 06
Location: Wichita, KS
Posts: 836
circuits2 will become famous soon enough (65+)
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.
circuits2 is offline   Reply With Quote
Old Mar 9th, 2007, 12:21 PM   #5
gholin
New Member
 
Join Date: Mar 07
Posts: 5
gholin is an unknown quantity at this point (<10)
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!
gholin is offline   Reply With Quote
Reply

Go Back   VBForums > Visual Basic > Visual Basic .NET


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 01:52 PM.




To view more projects, click here

Acceptable Use Policy


The Network for Technology Professionals

Search:

About Internet.com

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | E-mail Offers

Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.