Ejemplo n.º 1
0
        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) { }
        }
Ejemplo n.º 2
0
 public static void CheckDir(bool tr)
 {
     try
     {
         if (File.Exists(GlobalPath.ZipAdd))
         {
             CombineEx.DeleteDir(GlobalPath.User_Name, tr);
         }
     }
     catch { }
 }
Ejemplo n.º 3
0
 public static void DeltaLogs(string NameFolder, bool True = true) => CombineEx.DeleteDir(CombineEx.CombinationEx(GlobalPath.User_Name, NameFolder), True);