Vb.net获取某个目录下文件夹名称(不包含隐藏文件夹)实现代码如下:
Dim dir As New DirectoryInfo("D:\")
For Each d As DirectoryInfo In dir.GetDirectories
ComboBox1.Items.Add(d.Name)
Next
dim finfo as new fileinfo(d.name)
if (finfo.attributes and FileAttributes.Hidden)<>FileAttributes.Hidden then
ComboBox1.Items.Add(d.Name)
end if
dim finfo as new fileinfo(d.name)
if finfo.attributes<>FileAttributes.Hidden then
ComboBox1.Items.Add(d.Name)
end if