get the file path without filename in c# code example
Example: c# get path without filename
string fileAndPath = @"c:\webserver\public\myCompany\configs\promo.xml";
string currentDirectory = Path.GetDirectoryName(fileAndPath);
string fullPathOnly = Path.GetFullPath(currentDirectory);