Dim txtbx As String = "E:\_net_programs\test"
For Each d As String In Directory.GetDirectories(txtbx)
'For Each di As file
'Next
'MessageBox.Show(d)
'Dim folder As DirectoryInfo in directory
Next
请帮我循环一下这个文件夹" E:_net_programs \ test"并打开每个子文件夹
答案 0 :(得分:1)
有代码:
Dim txtbx As String = "E:\_net_programs\test"
For Each File In Directory.GetFiles(txtbx, "*", SearchOption.AllDirectories)
MsgBox(File)
Next
如果您不希望String
但FileInfo
的循环能够获取其属性(名称,父目录,扩展名等),则代码为:
Dim txtbx As String = "E:\_net_programs\test"
For Each File As FileInfo In New DirectoryInfo(txtbx).GetFiles("*", SearchOption.AllDirectories)
MsgBox(File.FullName)
Next