how to get directory path in c# code example
Example 1: get directory of file c#
using System.IO;
string file = "C:\Documents\file.txt";
Path.GetDirectoryName(file);
Example 2: get execution directory c#
string logsDirectory = Path.Combine(Environment.CurrentDirectory, "logs");