Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

get directory name of path c#

string filename = @"C:/folder1/folder2/file.txt";
string FolderName = new DirectoryInfo(System.IO.Path.GetDirectoryName(filename)).Name;
Comment

c# get directory name from filename

Path.GetDirectoryName(filename);
Comment

PREVIOUS NEXT
Code Example
Csharp :: blazor option selected 
Csharp :: public GameObject 
Csharp :: wpf scrollviewer mouse wheel 
Csharp :: how to freeze x and y position in rb2d with code unity 
Csharp :: tests not showing in test explorer 
Csharp :: json to httpcontent c# 
Csharp :: unity change tmp text from script 
Csharp :: small modal popup bootstrap 
Csharp :: video gets pixelated by scaling it up to Screen Size unity 
Csharp :: reverse for loop 
Csharp :: audio source pause unity 
Csharp :: fluentassertions force exceptions 
Csharp :: mathf.clamp unity 
Csharp :: import time C# 
Csharp :: c# LCP 
Csharp :: c# string default value 
Csharp :: replace double backslash with single backslash c# 
Csharp :: weighted random c# 
Csharp :: c# find duplicates in list of strings 
Csharp :: unity create a child object 
Csharp :: c# cast to type variable 
Csharp :: c# dictionary loop key value 
Csharp :: unity 2d movement 
Csharp :: c# do while loop 
Csharp :: convert.tostring with datetime string 
Csharp :: c# day of week number 
Csharp :: write line to file c# 
Csharp :: c# string remove 
Csharp :: failed to read the request form. missing content-type boundary .net core 
Csharp :: selection sort in c# 
ADD CONTENT
Topic
Content
Source link
Name
3+6 =