How to use sub string method in this condition?
=>C:\Users\A001\Foldername\filename
I want only folder name.How can I do this??
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Tom MohanRank #912 · 2.3K reputationPosted Apr 20, 2015, 5:22 AM EDT
Tom MohanRank #912 · 2.3K reputationPosted Apr 21, 2015, 6:39 AM EDT
I believe you got the solution .
Tom MohanRank #912 · 2.3K reputationPosted Apr 19, 2015, 10:25 PM EDT
try this
FileInfo fInfo = new FileInfo(@"D:\AD\folder1\abc.txt"); String dirName = fInfo.Directory.Name; Here I'm getting name folder1 in dirname;Asp.Net HeinRank #6,010 · 279 reputationPosted Apr 19, 2015, 10:36 PM EDT
Vikram AgrawalRank #4,713 · 329 reputationPosted Apr 19, 2015, 11:27 PM EDT
Hi Soe,
Are you getting this path as a string?
Khargesh RajputRank #616 · 3.9K reputationPosted Apr 20, 2015, 12:09 AM EDT
Asp.Net HeinRank #6,010 · 279 reputationPosted Apr 21, 2015, 5:18 PM EDT
I will need more help from u later.
:-)
Tom MohanRank #912 · 2.3K reputationPosted Apr 21, 2015, 9:14 PM EDT
Gowtham RajamanickamRank #57 · 29K reputationPosted Apr 20, 2015, 12:11 AM EDT