I am putting a check that if a directory by a name exists then it should delete that directory and replace it with the new one. For that i am having this code:
if (Directory.Exists(b))
{
Directory.Delete(b);
Directory.CreateDirectory(b);
}
where b is the name of the directory for which i am outting the check. I am getting a run time error that Directory is not empry, what shall i do?