多くのエントリを含む大きなテキスト ファイルがある場合、それらを取得してリストに保存する必要があります。
/// <summary>
/// Reads Data from the given path
/// </summary>
/// <param name="path">Path of the File to read</param>
public void Read(string path)
{
try
{
FileStream file = new FileStream(path, FileMode.Open);
StreamReader reader = new StreamReader(file);
string line;
while ((line = reader.ReadLine()) != null)
{
myList.Add(line);
System.Windows.Forms.Application.DoEvents();
}
reader.Close();
file.Close();
}
catch (Exception c)
{
MessageBox.Show(c.Message);
}
}