Код: Выделить всё
private List GetContours(int i, string filepath, out int
[,] segnum)
{
if (!File.Exists(filepath))
{
MessageBox.Show("No results for the requested contours were
returned.", "No Contours", MessageBoxButtons.OK,
MessageBoxIcon.Information);
segnum = new int[0, 0];
return null;
}
else
{
do
{
try
{
using (FileStream fs = File.OpenRead(filepath))
{
fs.Close();
break;
}
}
catch
{
string msg = "The file " + plotParms[id] + ".txt is
open. Close the file and click OK to proceed.";
MessageBox.Show(msg, "Open File",
MessageBoxButtons.OK, MessageBoxIcon.None);
break;
}
} while (true);
}
using (StreamReader sr = new StreamReader(filepath))
{
string line;
string[] column;
double depDate, arrDate;
bool segIsZero = false;
PointF point = new PointF(0F, 0F);
List segment = new List();
List segments = new List();
lstParmVals[i] = new List();
line = sr.ReadLine(); // Error occurs here
...
}
}
Я прочитал много сообщений о проблеме, которые появлялись в поиске Google. Кроме того, я перезагрузил компьютер и перезапустил VS и приложение без запуска других приложений, запускаемых пользователем. Результат был тот же. Компьютер новый, имеет очень быстрый процессор и 48 ГБ памяти.
Это сообщение об ошибке:
а это трассировка стека:
Подробнее здесь: https://stackoverflow.com/questions/791 ... tantiation
Мобильная версия