title: Get parent directory for some files C#
body: <p>I'm using</p>
  
  <pre><code>FolderBrowserDialog fbd = new FolderBrowserDialog();
  string[] filePaths = Directory.GetFiles(fbd.SelectedPath, "*",SearchOption.AllDirectories);
  </code></pre>
  
  <p>filePaths are the following:</p>
  
  <pre><code>C:\Users\Stef\Desktop\bgdm_v2015\bgdm.dll
  C:\Users\Stef\Desktop\bgdm_v2015\something.txt
  C:\Users\Stef\Desktop\bgdm_v2015\folder2\file.txt
  C:\Users\Stef\Desktop\bgdm_v2015\folder2\file2.txt
  C:\Users\Stef\Desktop\bgdm_v2015\folder2\folder3\file.txt
  </code></pre>
  
  <p>Is there any function to get the parent directory to the files?
  Like only </p>
  
  <pre><code>bgdm_v2015
  bgdm_v2015
  bgdm_v2015
  folder2
  folder2
  folder3
  </code></pre>