Hallo, ich mal wieder.
warum funktioniert UnauthorizedAccessException hier nicht. Er übergeht direkt alle Directories.
Kann mir da bitte jemand meinen Fehler sagen
Danke
Holger
warum funktioniert UnauthorizedAccessException hier nicht. Er übergeht direkt alle Directories.
VB.NET-Quellcode
- Private Sub ListFiles(ByVal [path] As String)
- Dim DirInfo As New DirectoryInfo(path)
- Dim FileObj As IO.FileSystemInfo
- Dim MySize As String
- Dim ValMB As Integer = Nothing
- Dim MB As String = txtMB.Text
- MB = MB & "000000"
- ValMB = CInt(MB)
- For Each FileObj In DirInfo.GetFileSystemInfos
- Try
- Catch ex As UnauthorizedAccessException
- If FileObj.Attributes = FileAttributes.Directory Then
- ListFiles(FileObj.FullName)
- Else
- MySize = FileLen(FileObj.FullName)
- If MySize >= ValMB Then
- Me.ListBox1.Items.Add(FileObj.FullName)
- End If
- End If
- Continue For
- End Try
- Next
- End Sub
Kann mir da bitte jemand meinen Fehler sagen
Danke
Holger