You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
- using System;
- using System.Collections.Generic;
- using System.IO;
- using System.Linq;
- using System.Text;
-
- namespace IPA.Patcher
- {
- public class BackupManager
- {
- public static void MakeBackup(string file)
- {
- File.Copy(file, GetBackupName(file));
- }
-
- private static string GetBackupName(string file)
- {
- string backup = file + ".Original";
-
- if (File.Exists(backup))
- {
- int i = 1;
- string backupBase = backup;
- while (File.Exists(backup))
- {
- backup = backupBase + i++;
- }
- }
- return backup;
- }
-
- }
- }
|