asp在线考试系统源码及设计 第7页
/// <summary>
/// 判断一个整数数组里面是否包括一个整数
/// </summary>
/// <param name="array">数组</param>
/// <param name="item">一个整数</param>
/// <returns></returns>
private bool ArrayHasItem(int[] array, int item)
{ for (int i = 0; i < array.Length; i++)
{
if (array[i] == item)
{
return true;
}
}
return false;
}
/// <summary>
/// 退出系统,并转到登陆页面,清除session
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Button2_Click(object sender, EventArgs e)
{
Session.Clear();
Response.Redirect("default.aspx");
}
/// <summary>
/// 交卷
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Button1_Click(object sender, EventArgs e)
{
int testnumber = Test.Rows.Count;
Response.Write(testnumber.ToString());
for (int i = 0; i < testnumber; i++)
{
string selvalue = ((RadioButtonList)GridView1.Rows[i].FindControl("RadioButtonList2")).SelectedValue;
userselect[i] = selvalue;
trueanswer[i] = Test.Rows[i]["answer"].ToString(); }
上一页 [1] [2] [3] [4] [5] [6] [7]