Last active
December 13, 2015 16:39
-
-
Save yujuwon/4942253 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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