Ejemplo n.º 1
0
 public static DirectoryInfo[] GetSubDirectories(DirectoryInfo path)
 {
     DirectoryInfo[] subDirs = null;
     try
     {
         SetAccessFolderRule(path.FullName);
         subDirs = path.GetDirectories().Where(x => !NavigationPane.BannedAttrExists(x)).ToArray();
     }
     catch (System.UnauthorizedAccessException)
     {
         return(null);
     }
     return(subDirs);
 }
Ejemplo n.º 2
0
 public static FileInfo[] GetSubFiles(DirectoryInfo path)
 {
     FileInfo[] subFiles = null;
     try
     {
         SetAccessFolderRule(path.FullName);
         subFiles = path.GetFiles().Where(x => !NavigationPane.BannedAttrExists(x)).ToArray();
     }
     catch (System.UnauthorizedAccessException)
     {
         MessageBox.Show("Access denied on file" + Environment.NewLine + path.FullName,
                         "Total Commander", MessageBoxButtons.OK, MessageBoxIcon.Error);
         return(null);
     }
     return(subFiles);
 }