Please use try catch block like below and get the exact exception :-
try
{
StreamReader sr = new StreamReader("C:\\Users/Kyle/Desktop/jhkhj/Year11-ActionElectivites.txt");
String line = sr.ReadToEnd();
string[] split = line.Split(',');
int ReadAllActionLines = 0;
while (ReadAllActionLines <= split.Length)
{
ActionListBox.Items.Add(split[ReadAllActionLines]);
ReadAllActionLines = ReadAllActionLines + 1;
}
sr.Close();
StreamReader sr2 = new StreamReader("C:\\Users/Kyle/Desktop/jhkhj/Year11-SurviceElectivites.txt");
String line2 = sr2.ReadToEnd();
string[] split2 = line2.Split(',');
int ReadAllActionLines2 = 0;
while (ReadAllActionLines2 <= split2.Length)
{
SurviceListBox.Items.Add(split2[ReadAllActionLines2]);
ReadAllActionLines2 = ReadAllActionLines2 + 1;
}
sr2.Close();
}
catch(Exception ex)
{
Messagebox.Show(ex.stacktrace);
}