private void scoreborad_Load(object sender, EventArgs e) { try { StreamReader sr = new StreamReader(filePath); string txt = sr.ReadLine(); while (txt != null) { string[] input = txt.Split(','); Indvscore stat = new Indvscore(input[0], Convert.ToInt32(input[1])); player.Addplayer(stat); txt = sr.ReadLine(); } sr.Close(); // Refresh Data List refreshDGV(); } catch (DirectoryNotFoundException) { Directory.CreateDirectory(directory); StreamWriter sw = createFile(); sw.Close(); } catch (FileNotFoundException) { StreamWriter sw = createFile(); sw.Close(); } }