Hi everyone can someone help me with a code that will detect where the user has installed the program, I want certain files to be saved in the installation directory of the program. Thnx
Here's a scrap of code I use in one of my services to set the working directory to be equal to the location of the exe that is running:
// Define working directory (For a service, this is set to System dir by default...)
Directory.SetCurrentDirectory(Path.GetDirectoryName(Process.GetCurrentProcess().MainModule.FileName));
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.