application location

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

How can I find where my application is installed? I have a Windows Service installed in C:\Program Files\MyApp I tried using Directory.GetCurrentDirectory but that returns C:\Winnt\System32 which isn't what I want. Any ideas?
 
Use Assembly.GetExecutingAssembly and Assembly.Location

--
Bob Powell [MVP]
C#, System.Drawing

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/gdiplus_faq.htm

Read my Blog at http://bobpowelldotnet.blogspot.com

Steve Richardson said:
How can I find where my application is installed? I have a Windows Service
installed in C:\Program Files\MyApp I tried using
Directory.GetCurrentDirectory but that returns C:\Winnt\System32 which isn't
what I want. Any ideas?
 
Application.StartupPath



How can I find where my application is installed? I have a Windows Service
installed in C:\Program Files\MyApp I tried using
Directory.GetCurrentDirectory but that returns C:\Winnt\System32 which isn't
what I want. Any ideas?
 
Back
Top