private static <fileinfo> GetFiles(string Path) { List<fileinfo> L = new List<fileinfo>(); DirectoryInfo D = new DirectoryInfo(Path); FileInfo F; try { foreach (DirectoryInfo DD in D.GetDirectories()) { foreach(FileInfo FF in DD.GetFiles("*.*")) { F = new FileInfo(FF.FullName); L.Add(F); } L.AddRange(GetFiles(DD.FullName)); } } catch { } }
Quote:Why failing
try { //your code }catch(Exception ex) { // Log the ex.ToString() or show it as message }
try...catch
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)