Visual Basic 2008 显示子目录及目录中的文件

Imports System.IO
Public Class Form1
Private Sub 显示所有子目录_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles 显示所有子目录.Click
Dim dirs() As String = Directory.GetDirectories("d:\")
For i = 0 To dirs.Length - 1
Debug.Print(dirs(i))
Next
End Sub
Private Sub 显示目录中的文件_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles 显示目录中的文件.Click
Dim files() As String = Directory.GetFiles("c:\windows")
Dim i As Integer
For i = 0 To files.Length - 1
Debug.Print(files(i))
Next
End Sub
End Class

你可能感兴趣的:(2008)