c# get path from filename code example
Example 1: python get filename from path
import os
print(os.path.basename(your_path))
Example 2: c# get path without filename
string fileAndPath = @"c:\webserver\public\myCompany\configs\promo.xml";
string currentDirectory = Path.GetDirectoryName(fileAndPath);
string fullPathOnly = Path.GetFullPath(currentDirectory);