Your array is not instantiated, dude:
string[] txtArr = new string[dataList.Count];
for (int i = 0; i < dataList.Count; i++)
{
txtArr[i] = dataList[i];
}
or you can do it like this:
string[] txtArr = dataList.ToArray();
or you can do it like this:
string[] txtArr = dict.ToList().Select(x => x.Value).ToArray();
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…