how extract each folder name path if don't know how many folders there in path , don't know folder names?
you can use string.split
:
string filename = @"c:\foo\bar\baz.txt"; string directory = path.getdirectoryname(filename); // "c:\foo\bar" string alldirectorynames = directory.split('\\'); // ["c:", "foo", "bar"]
Comments
Post a Comment