c# get current file path code example
Example 1: 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 2: c# read file current directory
var path = Path.Combine(Directory.GetCurrentDirectory(), "\\fileName.txt");
Example 3: c# get script directory
string appPath = System.IO.Path.GetDirectoryName(Application.ExecutablePath);