I am currently working on an antivirus in C#. I have one small problem though. When it scans the computer's files, it can't access files in AppData. How would I be able to search all directories except for one?
This is what I got so far(does not work):
Directory.GetFiles(path , "*.*", SearchOption.AllDirectories).Where(d => !d.StartsWith("<EXCLUDE_DIR_PATH>")).ToArray();
I keep on getting the error
Access to the path 'c:\Users\admin\AppData\Local\Application Data' is denied.