c# directories loop

C#
root.GetDirectories("*.*", System.IO.SearchOption.AllDirectories);  

Source

Also in C#: