retrieving directory path where project executable is

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • VM

    #1

    retrieving directory path where project executable is

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

    Thanks.




  • Ross Donald

    #2
    Re: retrieving directory path where project executable is

    Hi,

    If your app is a windows exe you can use

    Application.Sta rtupPath

    or

    Path.GetDirecto ryName(Applicat ion.ExecutableP ath)

    For assemblies you can use Assembly.Locati on

    --
    Ross Donald
    Rad Software
    Free Regular Expression Designer @
    Find information, resources and relevant links for radsoftware.com.au. This domain may be for sale.




    "VM" <Vm> wrote in message news:O06Ha9iiDH A.3712@tk2msftn gp13.phx.gbl...
    | How can I retrieve the whole directory where my exe is located?
    | I would've thought Directory.GetCu rrentDirectory worked but any event that
    | may change the dir (eg. OpenFileDialog or SaveFileDialog) will change the
    | current directory.
    |
    | Thanks.
    |
    |
    |
    |


    Comment

    • Ross Donald

      #3
      Re: retrieving directory path where project executable is

      Hi,

      If your app is a windows exe you can use

      Application.Sta rtupPath

      or

      Path.GetDirecto ryName(Applicat ion.ExecutableP ath)

      For assemblies you can use Assembly.Locati on

      --
      Ross Donald
      Rad Software
      Free Regular Expression Designer @
      Find information, resources and relevant links for radsoftware.com.au. This domain may be for sale.




      "VM" <Vm> wrote in message news:O06Ha9iiDH A.3712@tk2msftn gp13.phx.gbl...
      | How can I retrieve the whole directory where my exe is located?
      | I would've thought Directory.GetCu rrentDirectory worked but any event that
      | may change the dir (eg. OpenFileDialog or SaveFileDialog) will change the
      | current directory.
      |
      | Thanks.
      |
      |
      |
      |


      Comment

      Working...