/// <summary>Deletes the directory</summary> /// <exception cref="System.IO.IOException"></exception> public static void DeleteDir(string dir) { var absolutePath = new File(dir).GetCanonicalPath(); var fDir = new File(dir); if (fDir.IsDirectory()) { var files = fDir.List(); for (var i = 0; i < files.Length; i++) { DeleteDir(Path.Combine(absolutePath, files[i])); } } File4.Delete(dir); }
/// <summary>Deletes the directory</summary> /// <exception cref="System.IO.IOException"></exception> public static void DeleteDir(string dir) { string absolutePath = new Sharpen.IO.File(dir).GetCanonicalPath(); Sharpen.IO.File fDir = new Sharpen.IO.File(dir); if (fDir.IsDirectory()) { string[] files = fDir.List(); for (int i = 0; i < files.Length; i++) { DeleteDir(Path.Combine(absolutePath, files[i])); } } File4.Delete(dir); }