|
@@ -146,9 +146,22 @@ Public Class Form1
|
146
|
146
|
If fbd.ShowDialog() = DialogResult.OK Then '清除 DataGridView 中原本的資料
|
147
|
147
|
資料夾位置_tb.Text = fbd.SelectedPath
|
148
|
148
|
選取清單_dgv.Rows.Clear() : XX1 = 0 : MyModule1.計算結束() '掃描該位置內所有檔案名稱
|
149
|
|
- Dim files1() As String = IO.Directory.GetFiles(fbd.SelectedPath, "*.*", IO.SearchOption.AllDirectories)
|
150
|
|
- For Each file As String In files1 : MyModule1.計算顯示1()
|
151
|
|
- If 檔名_ch.Checked = True Then : 選取清單_dgv.Rows.Add(IO.Path.GetFileName(file)) : Else : 選取清單_dgv.Rows.Add(file) : End If : XX1 += 1
|
|
149
|
+
|
|
150
|
+ Dim files1() As String = IO.Directory.GetFiles(fbd.SelectedPath, "*.*", IO.SearchOption.TopDirectoryOnly)
|
|
151
|
+
|
|
152
|
+ For Each dir As String In IO.Directory.GetDirectories(fbd.SelectedPath)
|
|
153
|
+ If IO.Path.GetFileName(dir) = "System Volume Information" Or IO.Path.GetFileName(dir) = "$RECYCLE.BIN" Then Continue For
|
|
154
|
+ files1 = files1.Concat(IO.Directory.GetFiles(dir, "*.*", IO.SearchOption.AllDirectories)).ToArray()
|
|
155
|
+ Next
|
|
156
|
+
|
|
157
|
+ For Each file As String In files1
|
|
158
|
+ MyModule1.計算顯示1()
|
|
159
|
+ If 檔名_ch.Checked = True Then
|
|
160
|
+ 選取清單_dgv.Rows.Add(IO.Path.GetFileName(file))
|
|
161
|
+ Else
|
|
162
|
+ 選取清單_dgv.Rows.Add(file)
|
|
163
|
+ End If
|
|
164
|
+ XX1 += 1
|
152
|
165
|
Next : MyModule1.計算結束()
|
153
|
166
|
End If : 數量_lb.Text = "共 " & XX1 & " 個檔案"
|
154
|
167
|
End Sub
|