public static void CheckIsNullDirsAndFiles(string dir) { try { foreach (string d in Directory.EnumerateDirectories(dir)) { CheckIsNullDirsAndFiles(d); } foreach (string f in Directory.EnumerateFiles(dir)) { try { if (new FileInfo(f).Length == 0) { CombineEx.DeleteFile(f); } } catch (UnauthorizedAccessException) { } catch (IOException) { } } if (!Directory.EnumerateFileSystemEntries(dir).Any()) { CombineEx.DeleteDir(dir); } } catch (UnauthorizedAccessException) { } catch (IOException) { } }
public static void CheckDir(bool tr) { try { if (File.Exists(GlobalPath.ZipAdd)) { CombineEx.DeleteDir(GlobalPath.User_Name, tr); } } catch { } }
public static void DeltaLogs(string NameFolder, bool True = true) => CombineEx.DeleteDir(CombineEx.CombinationEx(GlobalPath.User_Name, NameFolder), True);