A programer who's dream to be a maker.
System.IO.DirectoryInfo myDirectory = new DirectoryInfo(path); // D:\doc\CAD\a.txt
string fatherDir = myDirectory.Parent.Name; //CAD
string grandfatherDir = myDirectory.Parent.Parent.Name;//doc
留言
張貼留言