private static void DeleteDirectory(string target_dir) { string[] files = Directory.GetFiles(target_dir); string[] directories = Directory.GetDirectories(target_dir); foreach (string path in files) { File.SetAttributes(path, FileAttributes.Normal); File.Delete(path); } foreach (string target_dir2 in directories) { SaveSlotUtils.DeleteDirectory(target_dir2); } Directory.Delete(target_dir, false); }
public static void DeleteSlot(PlayerModes mode, Slots slot) { string localSlotPath = SaveSlotUtils.GetLocalSlotPath(mode, slot); if (Directory.Exists(localSlotPath)) { SaveSlotUtils.DeleteDirectory(localSlotPath); } string[] array = CoopSteamCloud.ListFiles(); string cloudSlotPath = SaveSlotUtils.GetCloudSlotPath(mode, slot); for (int i = 0; i < array.Length; i++) { if (array[i].StartsWith(cloudSlotPath)) { CoopSteamCloud.CloudDelete(array[i]); } } }
private static void DeleteDirectory(string target_dir) { string[] files = Directory.GetFiles(target_dir); string[] directories = Directory.GetDirectories(target_dir); string[] array = files; for (int i = 0; i < array.Length; i++) { string path = array[i]; File.SetAttributes(path, FileAttributes.Normal); File.Delete(path); } string[] array2 = directories; for (int j = 0; j < array2.Length; j++) { string target_dir2 = array2[j]; SaveSlotUtils.DeleteDirectory(target_dir2); } Directory.Delete(target_dir, false); }