get path c# code example
Example 1: get program path c#
using System;
class Program
{
static void Main(string[] args)
{
string path;
path = AppDomain.CurrentDomain.BaseDirectory;
}
}
Example 2: c# get path without filename
var fn = openFileDialogSapTable.FileName;
var currentPath = Path.GetFullPath( fn );
currentPath = Directory.GetParent(currentPath).FullName;