У меня проблема с этим кодом; это вызвало StackOverflowException. Ошибка произошла в строке StreamReader readFile = new StreamReader(path)
.
У кого-нибудь есть идеи, как решить эту проблему? Спасибо.
public string[,] parseCSV(string path)
{
List<string[]> parsedData = new List<string[]>();
try
{
using (StreamReader readFile = new StreamReader(path))
{
string line;
string[] row;
baris = File.ReadAllLines(path).Length;
row = readFile.ReadLine().Split(',');
col = row.Length;
store = new string[baris, col];
int i = 0;
int j = 0;
foreach (string kolom in row)
{
store[i, j] = kolom;
j++;
}
i=1;
while ((line = readFile.ReadLine()) != null)
{
row = line.Split(',');
j = 0;
foreach (string kolom in row)
{
store[i, j] = kolom;
j++;
}
i++;
parsedData.Add(row);
}
}
}
catch (Exception e)
{
//MessageBox.Show(e.Message);
}
return store;
}