1

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.

daniel.jbatiz
  • 437
  • 4
  • 18

1 Answers1

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