title: 2nd to last level of a directory tree
body: <p>I am trying to get the 2nd to last level of the directory tree that I used an array to get.
  When it gets to the Console.WriteLine part, it doesn't display anything, it seems to skip that entire line.</p>
  
  <pre><code>foreach (string file in files)   
  {   
      string thepathoflife = Path.GetFullPath(file);
      string filetocopy = file;
      string location = file;
      bool b = false;
      string extension = Path.GetExtension(file);
      string thenameofdoom = Path.GetFileNameWithoutExtension(file);
      string filename = Path.GetFileName(file);
  
  
      //here is my attempt
      string dirthing = Path.GetDirectoryName(filename); //here is my attempt
      System.Console.WriteLine("" + dirthing); //here is my attempt
  </code></pre>