|
-
Apr 20th, 2011, 03:52 PM
#1
Thread Starter
Hyperactive Member
[RESOLVED] Get Folder Name
I have this path:
C:\SomeFolder\Folder1\file.txt
How do I get the name "Folder1"?
There are no GetFolderName function, only directory name
-
Apr 20th, 2011, 09:24 PM
#2
Re: Get Folder Name
A "Directory" is what we use to call a folder back before GUIs came along with their desktop metaphor.
-
Apr 21st, 2011, 12:09 AM
#3
Re: Get Folder Name
Path.GetFileName gets the leaf node from the path and Path.GetDirectoryName gets the rest. Call GetDirectoryName first to trim off the last node and create a new path, then call GetFileName to get the last node of that.
-
Apr 21st, 2011, 02:39 AM
#4
Thread Starter
Hyperactive Member
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|