Hi,

How can I find the directory where my application resides or where it was
launched from?
There are .Net functions that give current directory but not the application
directory.

Thank you

Vadim

Re: finding application directory by hirf-spam-me-here

hirf-spam-me-here
Thu May 13 01:21:00 CDT 2004

* "vadim" <vadim@dontsend> scripsit:
> How can I find the directory where my application resides or where it was
> launched from?
> There are .Net functions that give current directory but not the application
> directory.

\\\
Imports System.IO
Imports System.Reflection
.
.
.
Private Function ApplicationPath() As String
Return _
Path.GetDirectoryName([Assembly].GetExecutingAssembly().Location)
End Function
///

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>

Re: finding application directory by Mark

Mark
Thu May 13 03:54:23 CDT 2004

Hi Herfried. I would have used the following.

string myDir = System.IO.Directory.GetCurrentDirectory();

Or is there a reason to avoid it and use you method instead?
--

--

Br,
Mark Broadbent
mcdba , mcse+i
=============
"Herfried K. Wagner [MVP]" <hirf-spam-me-here@gmx.at> wrote in message
news:2ggignF2hpnpU2@uni-berlin.de...
> * "vadim" <vadim@dontsend> scripsit:
> > How can I find the directory where my application resides or where it
was
> > launched from?
> > There are .Net functions that give current directory but not the
application
> > directory.
>
> \\\
> Imports System.IO
> Imports System.Reflection
> .
> .
> .
> Private Function ApplicationPath() As String
> Return _
> Path.GetDirectoryName([Assembly].GetExecutingAssembly().Location)
> End Function
> ///
>
> --
> Herfried K. Wagner [MVP]
> <URL:http://dotnet.mvps.org/>



Re: finding application directory by Stoitcho

Stoitcho
Thu May 13 08:11:51 CDT 2004

Hi vadim,

If you are building WindowsForms application you can use Application class
for getting that info
Application.StartupPath is what you are after, I believe.

--
HTH
Stoitcho Goutsev (100) [C# MVP]


"vadim" <vadim@dontsend> wrote in message
news:uiilZ1KOEHA.2560@TK2MSFTNGP11.phx.gbl...
> Hi,
>
> How can I find the directory where my application resides or where it was
> launched from?
> There are .Net functions that give current directory but not the
application
> directory.
>
> Thank you
>
> Vadim
>
>



Re: finding application directory by hirf-spam-me-here

hirf-spam-me-here
Thu May 13 11:16:03 CDT 2004

* "Mark Broadbent" <no-spam-please@no-spam-please.com> scripsit:
> string myDir = System.IO.Directory.GetCurrentDirectory();
>
> Or is there a reason to avoid it and use you method instead?

The current directory can be changed. 'Application.StartupPath' is more
appropriate, IMO, but as far as I know, my solution is the most "stable"
;-).

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>

Re: finding application directory by Mark

Mark
Thu May 13 11:20:37 CDT 2004

ok cheers :-D

--

--

Br,
Mark Broadbent
mcdba , mcse+i
=============
"Herfried K. Wagner [MVP]" <hirf-spam-me-here@gmx.at> wrote in message
news:2ghladF2t4v1U1@uni-berlin.de...
> * "Mark Broadbent" <no-spam-please@no-spam-please.com> scripsit:
> > string myDir = System.IO.Directory.GetCurrentDirectory();
> >
> > Or is there a reason to avoid it and use you method instead?
>
> The current directory can be changed. 'Application.StartupPath' is more
> appropriate, IMO, but as far as I know, my solution is the most "stable"
> ;-).
>
> --
> Herfried K. Wagner [MVP]
> <URL:http://dotnet.mvps.org/>



Re: finding application directory by vadim

vadim
Thu May 13 13:56:08 CDT 2004

Thank you for your answers, guys.
Application.StartupPath is probably what I was looking for.

"Stoitcho Goutsev (100) [C# MVP]" <100@100.com> wrote in message
news:OJiGUuOOEHA.624@TK2MSFTNGP11.phx.gbl...
> Hi vadim,
>
> If you are building WindowsForms application you can use Application class
> for getting that info
> Application.StartupPath is what you are after, I believe.
>
> --
> HTH
> Stoitcho Goutsev (100) [C# MVP]
>
>
> "vadim" <vadim@dontsend> wrote in message
> news:uiilZ1KOEHA.2560@TK2MSFTNGP11.phx.gbl...
> > Hi,
> >
> > How can I find the directory where my application resides or where it
was
> > launched from?
> > There are .Net functions that give current directory but not the
> application
> > directory.
> >
> > Thank you
> >
> > Vadim
> >
> >
>
>