string currentDir = System.IO.Directory.GetCurrentDirectory();
//returns the current directory of the application when executing
System.IO.Path.GetDirectoryName(Assembly.GetEntryAssembly().Location);
string exePath = AppDomain.CurrentDomain.BaseDirectory;
// returns the directory where the .exe is located
var DDIR = System.IO.Directory.GetCurrentDirectory();
var WorkingDirectory = "";
int index = DDIR.IndexOf(@"");
if (index > 0)
WorkingDirectory = DDIR.Substring(0, index) + @"";
Environment.CurrentDirectory