void GetTestQuestion()
{// this function will randomly choose question from question array and store into new array named testQuestion
i = 0;
while (i < max)
{
Random();
if (question[num, 0] != string.Empty)
{
testQuestion[i, 0] = question[num, 0].ToString();
testQuestion[i, 1] = question[num, 1].ToString();
testQuestion[i, 2] = question[num, 2].ToString();
testQuestion[i, 3] = question[num, 3].ToString();
testQuestion[i, 4] = question[num, 4].ToString();
testQuestion[i, 5] = question[num, 5].ToString();
testQuestion[i, 6] = question[num, 6].ToString();
i++;
}
}
}
protected void Button3_Click(object sender, EventArgs e)
{// this button is to show the question into listbox...
for (i = 0; i < max; i++)
{
ListBox1.Items.Add(testQuestion[i, 1].ToString());
}
}
首先,我会从 Question Array 中随机选择一个问题并存储到 testQuestion 数组中。但是,在我点击按钮后,我的 testQestion 数组变为空值……出了什么问题?