FileStream fileread; FileStream filewrite; StreamReader scoreread; StreamWriter scorewitte; public void gethighscxore() { Boolean boolwork = true; // create fo fileread = new FileStream("ok.txt", FileMode.Open, FileAccess.Read); scoreread = new StreamReader(fileread); for (int i = 0; i < maxhscore; i++) { texthscore1[i] = scoreread.ReadLine(); if (texthscore1[i] == null) { texthscore1[i] = "0"; } } scoreread.Close(); fileread.Close(); if (boolwork) { int j = 0; for (int i = 0; i < maxhscore; i++) { if (plane_.score > Convert.ToInt32(texthscore1[i]) && i == j) { texthscore2[i] = plane_.score.ToString(); i++; if (i < maxhscore) { texthscore2[i] = texthscore1[j]; } } else { texthscore2[i] = texthscore1[j]; } j++; } } filewrite = new FileStream("ok.txt", FileMode.Create, FileAccess.Write); scorewitte = new StreamWriter(filewrite); for (int i = 0; i < maxhscore; i++) { scorewitte.WriteLine(texthscore2[i]); } scorewitte.Close(); filewrite.Close(); }
System.MethodAccessException
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)