VB.NET获取目录文件夹名称
1个回答
展开全部
Dim
dir
As
New
IO.DirectoryInfo("C:\TDDownload")
//
目录下就一个文件夹
If
dir.GetDirectories.Length
>
0
Then
MessageBox.Show(dir.GetDirectories.GetValue(0).ToString())
End
If
//
目录下多个文件夹
'For
Each
d
As
IO.DirectoryInfo
In
dir.GetDirectories
'
MessageBox.Show(d.FullName)
'Next
dir
As
New
IO.DirectoryInfo("C:\TDDownload")
//
目录下就一个文件夹
If
dir.GetDirectories.Length
>
0
Then
MessageBox.Show(dir.GetDirectories.GetValue(0).ToString())
End
If
//
目录下多个文件夹
'For
Each
d
As
IO.DirectoryInfo
In
dir.GetDirectories
'
MessageBox.Show(d.FullName)
'Next
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询
广告 您可能关注的内容 |