I am unable to delete the temporary folders directory. This is my code:
private void button8_Click(object sender, EventArgs e)
{
if(checkBox5.Checked == true)
{
try
{
string fileDirectory = @"C:\Users\Admin\AppData\Local\Temp";
if(Directory.Exists(fileDirectory))
{
Directory.Delete(fileDirectory);
}
}
catch(IOException ex)
{
MessageBox.Show(ex.Message);
}
}
else
{
MessageBox.Show("System has been cleaned!");
}
}