G'day all,
When i'm using the search function (Below) I get a Unauthorized Access Exception on certain folders, which isn't a problem, however after this Exception i'm not getting any results. I have tried searching around but I couldn't make sense of alot of stuff that I found. I haven't much experience in exception handling so any insight would be good. I've tried throwing the exeption and using "continue" but I don't really understand how to do that. Thanks!
try
{
// Loop through each ticked drive
foreach (string chkDrive in CkBox_Drives.CheckedItems)
{
foreach (string files in Directory.GetFiles(chkDrive, "*.exe", SearchOption.AllDirectories))
{
CkBox_Found.Items.Add(files);
}
}
}
catch (System.UnauthorizedAccessException excpt)
{
LBox_Errors.Items.Add((excpt.Message));
}