辞書ゲームを作ろうとしていますが、それぞれの行に約100,000語のテキストファイルがあります。私はこのコードを持っています:
words = new List<Word>();
Console.WriteLine("Please wait, compiling words list...");
TextReader tr = new StreamReader(DICT);
string line = tr.ReadLine();
while (line != "" && line != null) {
words.Add(new Word(line));
line = tr.ReadLine();
}
Console.WriteLine("List compiled with " + words.Count + " words.");
ただし、40510ワードで停止します。どうしてこれなの?そして、どうすれば問題を解決できますか?
ありがとうございました。