我正在尝试制作一个字典游戏,我有一个文本文件,每个文件都有大约 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 字。为什么是这样?我该如何解决这个问题?
谢谢你。