deleting entire folder including all the files inside
<p>The following is what i have when i try to delete a folder:</p>

<pre><code>namespace sortfolder
{
    class Program
    {
        static string path = "C:\\Work\\6.70_Extensions\\NightlyBuild\\";

        static void Main(string[] args)
        {
            var di = new DirectoryInfo("C:\\Work\\6.70_Extensions\\NightlyBuild");

            foreach (var file in di.GetFiles("*", SearchOption.AllDirectories))
                file.Attributes &amp;= ~FileAttributes.ReadOnly;

            var files = Directory.GetDirectories(path, "SASE Lab Tools.*");
            foreach(var file in files)
            Console.WriteLine(file);
            foreach(var file in files.OrderByDescending(x=&gt;x).Skip(7))
            Console.WriteLine(file);
            foreach(var file in files.OrderByDescending(x=&gt;x).Skip(7))
            Directory.Delete(file);
        }
    }
}
</code></pre>

<p>As mentioned in the title, i would like to delete this folder along with all its content. How do i go about doing it? Apparently i have IOException @ <code>Directory.Delete(file)</code> as it contains files</p>
