c# directories loop code example Example: c# directories loop root.GetDirectories("*.*", System.IO.SearchOption.AllDirectories);