public void LoadAgain() { for (int i = 0; i < 10; ++i) { highScore HS = Program.HighScore; int score = HS.getRank(i).getScore(); string name = HS.getRank(i).getName(); setProperty(bName[i], name); setProperty(bNo[i], "No " + (i + 1).ToString()); setProperty(bScore[i], score.ToString()); bName[i].Location = new Point(200, i * 50); bNo[i].Location = new Point(0, i * 50); bScore[i].Location = new Point(200 * 2, i * 50); } string Path = Program.exePath + "\\Data.txt"; if (System.IO.File.Exists(Path) == true) { highScore.WriteFile(Path, 1); } else { highScore.WriteFile(Path); } }
private void Leading_Board_Load(object sender, EventArgs e) { isMenu = true; isPlayAgain = false; highScore HS = Program.HighScore; string Path = Program.exePath + "\\Data.txt"; if (System.IO.File.Exists(Program.exePath + "\\Data.txt") == true) { highScore.ReadFile(Path); } else { highScore.WriteFile(Path, 1); } bName = new TextBox[10]; bNo = new TextBox[10]; bScore = new TextBox[10]; for (int i = 0; i < 10; ++i) { bName[i] = new TextBox(); bNo[i] = new TextBox(); bScore[i] = new TextBox(); int score = HS.getRank(i).getScore(); string name = HS.getRank(i).getName(); setProperty(bName[i], name); setProperty(bNo[i], "No " + (i + 1).ToString()); setProperty(bScore[i], score.ToString()); bName[i].Location = new Point(200, i * 50); bNo[i].Location = new Point(0, i * 50); bScore[i].Location = new Point(200 * 2, i * 50); } }