Skip to content

Instantly share code, notes, and snippets.

@yujuwon
Last active December 13, 2015 16:39
Show Gist options
  • Save yujuwon/4942253 to your computer and use it in GitHub Desktop.
Save yujuwon/4942253 to your computer and use it in GitHub Desktop.
DirectoryInfo aDir = new DirectoryInfo(path);
FileInfo[] files;
if (aDir == null)
{
return false;
}
DirectoryInfo[] directories = aDir.GetDirectories();
for (i = 0; i < directories.Length; i++)
{
files = directories[i].GetFiles();
for (j = files.Length-1; j >= 0; j--)
{
files[j].Delete();
}
}
files = aDir.GetFiles();
for(i=files.Length-1; i>=0; i--)
{
files[i].Delete();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment