/// <summary> /// method for colled info or delete files /// </summary> /// <param name="flag">flag delete</param> /// <returns>information</returns> public string CallClear(bool flag) { bool acess = true; if (!flag) { this.WalkDir(new DirectoryInfo(this.root), "system", flag, ref this.size, this.wayFile, ref acess, this.mask); } else { MyDeleteFile.DeleteFiles(this.wayFile); } return(string.Format("Recently documents: {0} KB:{1} File(-s)", this.size / 1000, this.wayFile.Count)); }
/// <summary> /// method for colled info or delete files /// </summary> /// <param name="flag">flag delete</param> /// <returns>information</returns> public string CallClear(bool flag) { bool acess = true; if (!flag) { this.WalkDir(new DirectoryInfo(this.rootApp), "system", flag, ref this.size, this.wayFile, ref acess); this.WalkDir(new DirectoryInfo(this.rootWindows), "system", flag, ref this.size, this.wayFile, ref acess); } else { MyDeleteFile.DeleteFiles(this.wayFile); } return(string.Format("Temporary files: {0} KB:{1} File(-s)", this.size / 1000, this.wayFile.Count)); }
/// <summary> /// method for colled info or delete files /// </summary> /// <param name="flag">flag delete</param> /// <returns>information</returns> public string CallClear(bool flag) { bool acess = true; if (!flag) { this.WalkDir(new DirectoryInfo(this.root), "system", flag, ref this.size, this.wayFile, ref acess, this.mask); this.root = Environment.GetFolderPath(Environment.SpecialFolder.Windows); this.WalkDir(new DirectoryInfo(this.root), "system", flag, ref this.size, this.wayFile, ref acess, this.mask); } else { MyDeleteFile.DeleteFiles(this.wayFile); } return(string.Format("Log Files: {0} KB:{1} File(-s)", this.size / 1000, this.wayFile.Count)); }
/// <summary> /// method for colled info or delete files /// </summary> /// <param name="flag">flag delete</param> /// <returns>information</returns> public string CallClear(bool flag) { Shell shell = new Shell(); Shell32.Folder Recycler = shell.NameSpace(10); if (!flag) { bool acess = true; foreach (FolderItem file in Recycler.Items()) { if (File.GetAttributes(file.Path).ToString().Contains((FileAttributes.Directory).ToString())) { base.WalkDir(new DirectoryInfo(file.Path), "system", false, ref size, this.wayFile, ref acess); this.wayDirs.Add(file.Path); } else { this.wayFile.Add(file.Path); size += file.Size; } } } else { MyDeleteFile.DeleteFiles(this.wayFile); foreach (var dir in this.wayDirs) { try { Directory.Delete(dir, true); } catch (Exception e) { DirectoryInfo del = new DirectoryInfo(dir); del.Attributes = FileAttributes.Normal; try { del.Delete(true); } catch (Exception ex) { } } } } return(string.Format("Recycle files: {0} KB:{1} File(-s)", this.size / 1000, this.wayFile.Count)); }
/// <summary> /// methof for called info or delete files /// </summary> /// <param name="flag">flag for delete</param> /// <returns>information </returns> public string CallClear(bool flag) { if (!flag) { bool acess = true; foreach (var mask in this.mask) { this.WalkDir(new DirectoryInfo(this.root), "system", flag, ref this.size, this.wayFile, ref acess, mask); } this.WalkDir(new DirectoryInfo(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData)), "system", flag, ref this.size, this.wayFile, ref acess, this.mask[0]); } else { MyDeleteFile.DeleteFiles(this.wayFile); } return(string.Format("Error Reporting Windows: {0} KB:{1} File(-s)", this.size / 1000, this.wayFile.Count)); }