c# get project directory path code example
Example 1: get application path c#
System.Reflection.Assembly.GetExecutingAssembly().Location
Example 2: get directory name of path c#
string filename = @"C:/folder1/folder2/file.txt";
string FolderName = new DirectoryInfo(System.IO.Path.GetDirectoryName(filename)).Name;