Delete folder with C# code?
<p>I am trying to delete a folder but i can manage to get it right?</p>

<p>The folder i am trying to delete is called <strong>ExtractedFiles</strong> and it is inside a folder called <strong>FormValue</strong>.</p>

<p>I can delete a spreadsheet in the same <strong>FormValue</strong> folder but cant delete the folder.</p>

<p>I think the problem might be that i don't have the right file extension for the folder</p>

<p>This works:</p>

<pre><code>if (File.Exists(tempFolderPathAlt + saveas + ".xls"))
            {
                File.Delete(tempFolderPathAlt + saveas + ".xls");
            }
</code></pre>

<p>This does not work:</p>

<pre><code> if (File.Exists(tempFolderPathAlt + "ExtractedFiles"))
            {
                File.Delete(tempFolderPathAlt + "ExtractedFiles");
            }
</code></pre>

<p>Could someone please tell me the file extension of a folder or how to delete one?</p>
