retrieving directory path where project executable is

  • Thread starter Thread starter VM
  • Start date Start date
V

VM

How can I retrieve the whole directory where my exe is located?
I would've thought Directory.GetCurrentDirectory worked but any event that
may change the dir (eg. OpenFileDialog or SaveFileDialog) will change the
current directory.

Thanks.
 
Hi,

If your app is a windows exe you can use

Application.StartupPath

or

Path.GetDirectoryName(Application.ExecutablePath)

For assemblies you can use Assembly.Location

--
Ross Donald
Rad Software
Free Regular Expression Designer @
http://www.radsoftware.com.au/web/Products/



"VM" <Vm> wrote in message | How can I retrieve the whole directory where my exe is located?
| I would've thought Directory.GetCurrentDirectory worked but any event that
| may change the dir (eg. OpenFileDialog or SaveFileDialog) will change the
| current directory.
|
| Thanks.
|
|
|
|
 
Back
Top