-
Current path in windows application
Hi,
If I want to get the current path of the application(not the bin)? what is
the best way? It seems all the methods return including bin which I don't
want.
thanks in advance
-
Re: Current path in windows application
> If I want to get the current path of the application
> (not the bin)?
Ram: If you don't want the location of the \bin folder, which is where the
executable resides, what do you mean by "current path of the application?"
--
Phil Weber
-
Re: Current path in windows application
"Phil Weber" <pweber@nospam.fawcette.com> wrote:
> > If I want to get the current path of the application
> > (not the bin)?
>
>Ram: If you don't want the location of the \bin folder, which is where the
>executable resides, what do you mean by "current path of the application?"
>--
>Phil Weber
>
>
Phil, What I mean is my source file is not going to be in \bin directory
and I need the directory where my .vbproj,.sln programs reside(please correct
me if my understanding is wrong - All the source files are stored in one
level up of the \bin)
Source file path : c:\test\test.vbproj
bin path : c:\test\bin
What I want is c:\test in my code. I can always get the c:\test from "c:\test\bin"
but my question is that is there any direct way to get the path?
thanks in advance
RAM
-
Re: Current path in windows application
G'day Ram.
>Source file path : c:\test\test.vbproj
>bin path : c:\test\bin
Looks like the only thing this would be useful for is a visual studio addin
- obviously with a typical release app the source code files would be both
unavailable and mostly useless... If what you are working on is an addin,
then look at the VSProject object - accessed via the DTE object, Projects
property, I believe...
HTH,
Cheers,
Paul
-
Re: Current path in windows application
>Phil, What I mean is my source file is not going to be in \bin directory
>and I need the directory where my .vbproj,.sln programs reside(please correct
>me if my understanding is wrong - All the source files are stored in one
>level up of the \bin)
In .NET the default is no longer one level up. It looks like this "c:\myDir\bin\Debug
or Release". If you have not changed the settings.
>
>Source file path : c:\test\test.vbproj
>bin path : c:\test\bin
>
>What I want is c:\test in my code. I can always get the c:\test from "c:\test\bin"
>but my question is that is there any direct way to get the path?
If you know the structure you can always use a relative path the current
local directory. IE
Path = get local path
mypath = ..\..\Path - minus all the excess.
There is no need to go to indepth using DTE. It is not trivial to figure
out how to work directly with projects. But, I do have an add-in that does
all of the DTE work for you. Pretty sweet. Anyway, hope that helps.
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
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks