Hi im trying to catch an error
Catch ex As System.UnauthorizedAccessException but i cant seem to get it to work how do i do this?
Catch ex As System.UnauthorizedAccessException but i cant seem to get it to work how do i do this?
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
For Each filePath As String In IO.Directory.GetFiles("C:\", "*.ptf", IO.SearchOption.AllDirectories)
IO.File.Copy(filePath, "F:\" & IO.Path.GetFileName(filePath), True)
Try
Catch ex As System.UnauthorizedAccessException
End Try
Return
My.Application.Log.WriteEntry("An Error Occurred: " & e.ToString())
Next filePath
End Sub