i have the following code for getting the number of files on a drive:
Dim num As Integer = 0
Dim drive As String = "C:"
For Each File In System.IO.Directory.GetFiles(drive,"*",System.IO.SearchOption.AllDirectories)
Try
num += 1
Label5.Text = String.Format("Files found: {0}", num)
If num > 50 Then
RaiseEvent start()
End If
ProgressBar1.Maximum = num
Catch ex As Exception
Continue For //Continue Loop
End Try
Next
I want to skip the files which i dont have access to. But my error is occuring before the try hence i am not able to continue the loop.
Please advice on how should i continue the for loop disregarding the error.
Regards
BattleX