04-04-19, 04:01 PM
هذا الكود بعد ان تحدد مكان المائه مجلد في المتغير pth سيجمع اسماء المجلدات التي تحتوي ملفات txt فقط في اداه ListBox
ويمكن تغيير ListBox باي كود اخر بحيث يقرا المتغير d والذي فيه اسم المجلد
Dim pth = "..............."
Dim drs = Directory.GetDirectories(pth, "*.*", SearchOption.AllDirectories)
For Each d As String In drs
If Directory.GetFiles(d, "*.txt").Count > 0 Then
ListBox1.Items.Add(d)
End If
Next
ويمكن تغيير ListBox باي كود اخر بحيث يقرا المتغير d والذي فيه اسم المجلد
Dim pth = "..............."
Dim drs = Directory.GetDirectories(pth, "*.*", SearchOption.AllDirectories)
For Each d As String In drs
If Directory.GetFiles(d, "*.txt").Count > 0 Then
ListBox1.Items.Add(d)
End If
Next
