Good Morning! So I want to create a Multidimensional Array for a CSV-File in C#. I programmed this Code, but it doesn't work. Can somebody help me?
StreamReader sr = new StreamReader(@"C:\_repos\2021-3xhit-p1-team-02\Programm\CodeZuweisen.txt");
string[,] info = new string[10,6];
int line = 0;
string content = sr.ReadToEnd();
string[] s = content.Split(',');
for (int i = 0; i < s.Length; i++)
{
if (i % 6 == 0 && i!=0)
{
++line;
}
else
{
info[line, i] = s[i];
}
}
lblAusgabe.Text = info[1,2];
If I want to run this program, there is no output? I already programmed it in java, and it also works, but I don't like C# :D.
Any kind of help would be awesome! Have a nice day!