title: foreach loop finally
body: <p>I have a foreach loop that has try catch and finally. it goes through files in a folder and  finally deletes them all....but now if i have two files, as it is deleting all( i need to delete all because of app functionality) it will not go though second file. is it possible to let foreach loop finish then delete all files in foreach method here is an example:</p>
  
  <pre><code>foreach (DirectoryInfo directory in directories)
  {
      foreach (FileInfo file in directory.GetFiles("*.csv"))
      {
          try
          {
             //do something with file
  
          }
  
          catch (Exception e)
          {
              //catch exception
          }
          finally
          {
              if (!IsFileLocked(file))
              {
                  string[] files = Directory.GetFiles(@"C:\Test");
                  foreach (string filetoDelete in files)
                  {
                      File.Delete(filetoDelete);
                  }
              }
          }
      }
  }
  </code></pre>
  
  <p>hope it is clear enough.</p>