29-07-13, 06:18 PM
ضع هذه الطريقة
وعند الاستدعاء ضع الكود في زر بوتون مثلآ
كود :
Private Sub GetFiles(ByVal path As String)
Try
For Each folder As String In IO.Directory.GetDirectories(path)
Application.DoEvents()
GetFiles(folder)
Next
For Each files As String In IO.Directory.GetFiles(path)
Application.DoEvents()
ListBox1.Items.Add(files)
Next
Catch ex As Exception
End Try
End Subوعند الاستدعاء ضع الكود في زر بوتون مثلآ
كود :
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
ListBox1.Items.Clear()
GetFiles("مسار المجلد الذي يحوي على الفولدرات")
End Sub
