Answers for "c# get path without filename"

C#
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);
Posted by: Guest on September-15-2020
1

c# get path without filename

var fn = openFileDialogSapTable.FileName;
var currentPath = Path.GetFullPath( fn );
currentPath = Directory.GetParent(currentPath).FullName;
Posted by: Guest on October-20-2020

Code answers related to "c# get path without filename"

C# Answers by Framework

Browse Popular Code Answers by Language