|
-
Apr 17th, 2003, 01:28 AM
#1
Thread Starter
Registered User
Set Application Path [Resolved]
In VB 6.0, we used to set the Application Path = App.Path.
How can we do this in VB .NET? (without changing the startup project path). So that we will not have to change the full path.
Please help. 10q!
Last edited by albertlse; Aug 21st, 2003 at 08:36 PM.
-
Apr 17th, 2003, 04:21 AM
#2
Lively Member
If it's the current working directory you want to set check out the help on the 'Directory' class.
It has a shared member called SetCurrentDirectory that might do the trick, that is if i understand what you are trying to do.
-
Apr 17th, 2003, 05:56 AM
#3
Lively Member
As luck would have it, I've just stumbled across this on another forum...
"App.Path has been replaced with Application.StartupPath"
Not sure what the forum rules are about posting links to other non-VBforums.com forum posts, but if you email me i will send it to you.
-
Apr 17th, 2003, 07:56 AM
#4
Sleep mode
Application.StartupPath would move you to where your exe is executed (generally in bin folder) .
-
Apr 17th, 2003, 11:11 AM
#5
Thread Starter
Registered User
Thanks for replying my problem.
I would like to make my problem clear once again. Hope it is clear this time.
In VB 6.0, we use "App.Path" to set the path dynamically on run-time.
How can I do so in VB .NET?
FYI, my project path is "C:\Project".
I do have an Image folder at "C:\Project\Image".
By using "Application.StartupPath" always include the path we work on + \bin folder. "C:\Project\bin".
By default, the \bin folder is where the application (*.exe) is being built.
This cause some trouble as my program is going to retrieve image files from "C:\Project\Image".
This means that if i use "Application.StartupPath", i need to move the Image folder to the \bin folder. "C:\Project\bin\Image".
I knew that I can change the StartupPath to "C:\Project". This means that the application will be build here instead of "C:\Project\bin".
Is there any alternative ways for me to solve this problem, so that I can still use the \bin folder to build my application
and also do not need to move the Image folder to the \bin folder.
-
Apr 17th, 2003, 05:01 PM
#6
I wonder how many charact
In reality this is only a problem while you're developing the application right? Once you release it for distribution, you are going to have to include that directory of images or your app creates them in its own directory...
So in the meantime, simply copying the image directory into your solution folder works...
Or am I missing something?
-
Apr 18th, 2003, 02:23 AM
#7
Sleep mode
Well , I can't see any problem here. When you build your exe and have it deployed , then you won't have a bin folder .Your startup path would be the folder where your exe is executed .
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|