title: c# populate string list with recursive directory path
body: <p>I need to populate a string list with <strong>not empty</strong> recursive directory path.</p>
  
  <p>with this code i can get the directory path and the number of subfolders:</p>
  
  <pre><code>string path = Environment.ExpandEnvironmentVariables(@"f:\PAB\");
  int directoryCount = System.IO.Directory.GetDirectories(@path).Length;
  string[] directoryArray = Directory.GetDirectories(path);
  </code></pre>
  
  <p>I want to populate a new list string with not empty directories</p>
  
  <p>I think maybe I can use this code:</p>
  
  <pre><code>for (int i = 0; i &lt; directoryCount; i++)
  {
      if (Directory.GetFiles(directoryArray[i]).Length != 0)
  </code></pre>
  
  <p>but I'm totally newbie with c# and I don't konw how can I do this.</p>