How do I read an .ini-file with a Win service on Windows7

I have installed my Service and the .exe-file is located in C:\Program Files (x86)\MyService. I want to read some values from a .ini-file that also should be located in the same folder.

I have previously used the following code to  read file in the same folder as the service exe-file : path = Environment.CurrentDirectory + "\\Mysettings.ini";

When I debug the service I can see that Mysettings.ini must be located in c:\windows\syswow64 to get it to work. What other code than  Environment.CurrentDirectory should I use to get the right path ?
Mackey_manAsked:
Who is Participating?
 
buraksaricaConnect With a Mentor Commented:
try AppDomain.CurrentDomain.SetupInformation.ApplicationBase
0
 
Mackey_manAuthor Commented:
Thanks a lot !
0
All Courses

From novice to tech pro — start learning today.