vb.net 获取目录下文件夹名不包括隐藏文件夹
答案:2 悬赏:30 手机版
解决时间 2021-12-03 22:21
- 提问者网友:精神病院里
- 2021-12-03 14:07
vb.net 获取目录下文件夹名不包括隐藏文件夹
最佳答案
- 五星知识达人网友:枭雄戏美人
- 2021-12-03 15:29
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 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
全部回答
- 1楼网友:时间的尘埃
- 2021-12-03 16:41
dim finfo as new fileinfo(d.name)
if finfo.attributes<>FileAttributes.Hidden then
ComboBox1.Items.Add(d.Name)
end if追问判别不出来呀、还是一起都加进去了追答(finfo.attributes and FileAttributes.Hidden) <>FileAttributes.Hidden
if finfo.attributes<>FileAttributes.Hidden then
ComboBox1.Items.Add(d.Name)
end if追问判别不出来呀、还是一起都加进去了追答(finfo.attributes and FileAttributes.Hidden) <>FileAttributes.Hidden
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯