索引超出数组界限?
private void 英汉词典_Load(object sender, EventArgs e)
{
toolTip1.InitialDelay = 0;
toolTip1.ReshowDelay = 0;
toolTip1.SetToolTip(textBox1, "请输入您要查找的单词");
for (int i = 0; i < strArr.Length; i++)
{
string[] strArr1 = strArr[i].Split(new char[] {' '}, StringSplitOptions.RemoveEmptyEntries);
if ((dic.Keys.Contains(strArr1[0]) == false)||(strArr1.Length > 1))
{
dic.Add(strArr1[0], strArr1[1]); }
}
}
就这样。。。求解。。。
------解决方案--------------------
if (strArr1.Length > 1 && (dic.Keys.Contains(strArr1[0]) == false))