can someone tell me how to get the current path of my C# application; I need to load a DB , and I want my program get the DB from its own path, It’s something like GetEnviromentArgs , I don’t know.
Asked
Active
Viewed 74 times
1
-
is this on a web server or in a desktop application? – AussieJoe May 16 '18 at 21:01
1 Answers
2
to get the execution folder:
System.IO.Path.GetDirectoryName(Assembly.GetEntryAssembly().Location);
to get the current directory:
Directory.GetCurrentDirectory()
they aren't necessarily the same thing, so be careful

Marc Frame
- 923
- 1
- 13
- 26