Private Sub UIGetAllFiles(ByVal strPath As String)
If strPath <> String.Empty Then
Dim oFile As FileInfo
Dim oFolder As DirectoryInfo
Dim oPath As New DirectoryInfo(strPath)
Try
For Each oFile In oPath.GetFiles
For Each oFolder In oPath.GetDirectories()
Call UIGetAllFiles(oFolder.FullName)
Next
Catch ex As Exception
ShowMessage(enuMessageType.MTError, ex.Message)
End Try
End If
End Sub
If strPath <> String.Empty Then
Dim oFile As FileInfo
Dim oFolder As DirectoryInfo
Dim oPath As New DirectoryInfo(strPath)
Try
For Each oFile In oPath.GetFiles
'-----------------------处理每个文件
Next
For Each oFolder In oPath.GetDirectories()
Call UIGetAllFiles(oFolder.FullName)
Next
Catch ex As Exception
ShowMessage(enuMessageType.MTError, ex.Message)
End Try
End If
End Sub