我想把当前文件夹下的所有子文件夹列出来,可是里面的文件也都列出来了,谁能帮帮我谢谢!
这是代码
Private Sub Button1_Click( ByVal sender As System.Object, ByVal& ;nbs p;e As System.EventArgs) Handles Button1 .Click
Dim MyN ame As String
MyName = Dir(CurDir() + "\", FileAttribute.Dire ctory)
Do Whil e MyName <> ""
ListBox1.Items.Add(MyName)
MyName = Dir()
Loop
End Sub
这是代码
Private Sub Button1_Click( ByVal sender As System.Object, ByVal& ;nbs p;e As System.EventArgs) Handles Button1 .Click
Dim MyN ame As String
MyName = Dir(CurDir() + "\", FileAttribute.Dire ctory)
Do Whil e MyName <> ""
ListBox1.Items.Add(MyName)
MyName = Dir()
Loop
End Sub
解决方案 »
- 如何用API加载"C:\A.ICO"图标?
- vista中引起窗口位置及尺寸发生改变的原因是什么?
- Microsoft MSDN Library 2004兼容VB6吗?
- 谁有甘特图的控件
- CreateWindowEx函数在中文XP,2000下运行正常,在英文XP下就Run time error '13'
- ★★小型连锁店的信息传递问题★★
- 用VB6.0怎么能得出当前的IP?
- 不动工作站的系统,如何通过服务器让工作站自动执行局域网服务器的应用程序
- 如何检测一个窗体上的控件是IMAGE对象?
- 报表问题DataReport
- automation 错误
- Printer.PaintPicture Picture1.image, 100, 1000 打印时,为什么打印...???
Private Sub Button1_Click( ByVal sender As System.Object, ByVal& ;nbs p;e As System.EventArgs) Handles Button1 .Click
Dim MyName As String
MyName = Dir("c:\", vbDirectory)
Do While MyName <> ""
If (GetAttr("c:\" & MyName) And vbDirectory) = vbDirectory Then
ListBox1.Items.Add(MyName)
End If
MyName = Dir()
Loop
End Sub
If GetAttr("c:\" & MyName) And vbDirectory Then