How to get the path of the application being run?

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

    How to get the path of the application being run?

    I have a service that create an instance of
    a class Donkey that is compiled to an EXE
    at the location c:\animals.

    Since i run the thing as a service, i get
    the working directory to be
    c:\windows\syst em32
    but i'd need to know what directory the
    class is located in. That's where i'll have
    my config files, namely.

    --
    Regards
    Konrad Viltersten
    ----------------------------------------
    May all spammers die an agonizing death;
    have no burial places; their souls be
    chased by demons in Gehenna from one room
    to another for all eternity and beyond.


  • Duggi

    #2
    Re: How to get the path of the application being run?

    On Sep 23, 1:55 pm, "K Viltersten" <t...@vilterste n.comwrote:
    I have a service that create an instance of
    a class Donkey that is compiled to an EXE
    at the location c:\animals.
    >
    Since i run the thing as a service, i get
    the working directory to be
      c:\windows\syst em32
    but i'd need to know what directory the
    class is located in. That's where i'll have
    my config files, namely.
    >
    --
    Regards
    Konrad Viltersten
    ----------------------------------------
    May all spammers die an agonizing death;
    have no burial places; their souls be
    chased by demons in Gehenna from one room
    to another for all eternity and beyond.
    Assembly.GetExe cutingAssembly( ).Location should solve it..

    -Cnu



    Comment

    • K Viltersten

      #3
      Re: How to get the path of the application being run?

      >I have a service that create an instance of
      >a class Donkey that is compiled to an EXE
      >at the location c:\animals.
      >>
      >Since i run the thing as a service, i get
      >the working directory to be
      >c:\windows\sys tem32
      >but i'd need to know what directory the
      >class is located in. That's where i'll have
      >my config files, namely.
      >
      Assembly.GetExe cutingAssembly( ).Location
      should solve it.
      Thanks!
      I think it should do it.



      --
      Regards
      Konrad Viltersten
      ----------------------------------------
      May all spammers die an agonizing death;
      have no burial places; their souls be
      chased by demons in Gehenna from one room
      to another for all eternity and beyond.



      Comment

      Working...