public static void Increment(string file) { long count = 0; if (File.Exists(file)) { Int64.TryParse(File.ReadAllText(file), out count); } count++; File.WriteAllText(file, "" + count); }