Get directories and files with recursion?
<p>Is possible to get all directories, subdirectories and files with recursion.</p>

<p>I do this because i want to increase my programming logic, and learn how recursion work.</p>

<p>I know to do that with this way:</p>

<pre><code> string path = "D://";
            string rezdir,newpath;
            DirectoryInfo di = new DirectoryInfo(path);
            DirectoryInfo[] dir = di.GetDirectories().ToArray();
            for (int i = 0; i &lt; di.GetDirectories().Length; i++)
            {
                Console.WriteLine(dir[i].ToString());
            }
            Console.WriteLine("\n\nChoose File: ");
            rezdir = Console.ReadLine();
            newpath = path + rezdir;
            di = new DirectoryInfo(newpath);
            dir = di.GetDirectories().ToArray();
            for (int i = 0; i &lt; di.GetDirectories().Length; i++)
            {
                Console.WriteLine(dir[i].ToString());
            }
            Console.ReadKey();
</code></pre>

<p>But i don't do that with recursion way, so ff someone can to do this, i'll be grateful to him.</p>
