c# get current folder code example
Example 1: c# get current directory
string currentDir = System.IO.Directory.GetCurrentDirectory();
Example 2: get current directory c# \
System.IO.Path.GetDirectoryName(Assembly.GetEntryAssembly().Location);
Example 3: get working directory c#
var DDIR = System.IO.Directory.GetCurrentDirectory();
var WorkingDirectory = "";
int index = DDIR.IndexOf(@"\");
if (index > 0)
WorkingDirectory = DDIR.Substring(0, index) + @"\";
Example 4: c# windows application get current path
System.IO.Path.GetDirectoryName(Application.ExecutablePath);