```
DirectoryInfo dir = new DirectoryInfo(inputpath);//@"c:\"
foreach (DirectoryInfo dChild in dir.GetDirectories("*"))//如果用GetDirectories("ab*"),那么全部以ab开头的目录会被显示
{
Console.WriteLine(dChild.Name);//打印目录名
//Console.WriteLine(dChild.FullName );//打印路径和目录名
//宝贝名字
itemname = dChild.Name;
}
```