《在線(xiàn)考試系統(tǒng)代碼》PPT課件.ppt
《《在線(xiàn)考試系統(tǒng)代碼》PPT課件.ppt》由會(huì)員分享,可在線(xiàn)閱讀,更多相關(guān)《《在線(xiàn)考試系統(tǒng)代碼》PPT課件.ppt(10頁(yè)珍藏版)》請(qǐng)?jiān)谘b配圖網(wǎng)上搜索。
一個(gè)在線(xiàn)考試系統(tǒng)的代碼設(shè)計(jì),www.kasong-,www.youlvjing-,www.a-,www.a-,,(1)登陸頁(yè)面,protectedvoidbtnlogin_Click(objectsender,EventArgse)if(txtCode.Text.Trim()!=Sessionverify.ToString()Response.Write(alert(驗(yàn)證碼錯(cuò)誤);location=Login.aspx);elseif(this.ddlstatus.SelectedValue=學(xué)生)if(BaseClass.CheckStudent(txtNum.Text.Trim(),txtPwd.Text.Trim()SessionID=txtNum.Text.Trim();Response.Redirect(student/studentexam.aspx);elseResponse.Write(alert(您不是學(xué)生或者用戶(hù)名和密碼錯(cuò)誤);location=Login.aspx);if(this.ddlstatus.SelectedValue=教師)if(BaseClass.CheckTeacher(txtNum.Text.Trim(),txtPwd.Text.Trim()Sessionteacher=txtNum.Text;Response.Redirect(teacher/TeacherManage.aspx);elseResponse.Write(alert(您不是教師或者用戶(hù)名和密碼錯(cuò)誤);location=Login.aspx);if(this.ddlstatus.SelectedValue=管理員)if(BaseClass.CheckAdmin(txtNum.Text.Trim(),txtPwd.Text.Trim()Sessionadmin=txtNum.Text;Response.Redirect(admin/AdminManage.aspx);elseResponse.Write(alert(您不是管理員或者用戶(hù)名和密碼錯(cuò)誤);location=Login.aspx);protectedvoidbtnconcel_Click(objectsender,EventArgse)RegisterStartupScript(提示,window.close(););,(2)添加信息學(xué)生代碼,protectedvoidPage_Load(objectsender,EventArgse)if(Sessionadmin=null)Response.Redirect(./Login.aspx);protectedvoidbtnSubmit_Click(objectsender,EventArgse)if(txtName.Text=|txtNum.Text=|txtPwd.Text=)MessageBox.Show(請(qǐng)將信息填寫(xiě)完整);return;elseSqlConnectionconn=BaseClass.DBCon();conn.Open();SqlCommandcmd=newSqlCommand(selectcount(*)fromtb_StudentwhereStudentNum=+txtNum.Text+,conn);inti=Convert.ToInt32(cmd.ExecuteScalar();if(i0)MessageBox.Show(此學(xué)號(hào)已經(jīng)存在);return;elsecmd=newSqlCommand(insertintotb_Student(StudentNum,StudentName,StudentSex,StudentPwd)values(+txtNum.Text.Trim()+,+txtName.Text.Trim()+,+rblSex.SelectedValue.ToString()+,+txtPwd.Text.Trim()+),conn);cmd.ExecuteNonQuery();conn.Close();MessageBox.Show(添加成功);btnConcel_Click(sender,e);protectedvoidbtnConcel_Click(objectsender,EventArgse)txtName.Text=;txtNum.Text=;txtPwd.Text=;,publicpartialclassadmin_ChangeStudentInfo:System.Web.UI.Pageprivatestaticintid;protectedvoidPage_Load(objectsender,EventArgse)if(Sessionadmin=null)Response.Redirect(./Login.aspx);if(!IsPostBack)id=Convert.ToInt32(Request.QueryStringstuid);SqlConnectionconn=BaseClass.DBCon();conn.Open();SqlCommandcmd=newSqlCommand(select*fromtb_StudentwhereID=+id,conn);SqlDataReadersdr=cmd.ExecuteReader();sdr.Read();txtStuName.Text=sdrStudentName.ToString();txtStuNum.Text=sdrStudentNum.ToString();txtStuPwd.Text=sdrStudentPwd.ToString();rblSex.SelectedValue=sdrStudentSex.ToString();sdr.Close();conn.Close();protectedvoidbtnSava_Click(objectsender,EventArgse)if(txtStuName.Text.Trim()=|txtStuPwd.Text.Trim()=)MessageBox.Show(請(qǐng)將信息填寫(xiě)完整);return;elsestringstr=updatetb_StudentsetStudentName=+txtStuName.Text.Trim()+,StudentPwd=+txtStuPwd.Text.Trim()+,StudentSex=+rblSex.SelectedItem.Text+whereID=+id;BaseClass.OperateData(str);Response.Redirect(StudentInfo.aspx);protectedvoidbtnConcel_Click(objectsender,EventArgse)Response.Redirect(StudentInfo.aspx);,(3)修改學(xué)生信息,(4)添加試題,添加試題信息代碼如下:protectedvoidPage_Load(objectsender,EventArgse)if(Sessionadmin=null)Response.Redirect(./Login.aspx);if(!IsPostBack)SqlConnectionconn=BaseClass.DBCon();conn.Open();SqlCommandcmd=newSqlCommand(select*fromtb_Lesson,conn);SqlDataReadersdr=cmd.ExecuteReader();this.ddlkm.DataSource=sdr;this.ddlkm.DataTextField=LessonName;this.ddlkm.DataValueField=ID;this.ddlkm.DataBind();this.ddlkm.SelectedIndex=0;conn.Close();protectedvoidbtnconfirm_Click(objectsender,EventArgse)if(txtsubject.Text=|txtAnsA.Text=|txtAnsB.Text=|txtAnsC.Text=|txtAnsD.Text=)MessageBox.Show(請(qǐng)將信息填寫(xiě)完整);return;elsestringisfb=;if(cbFB.Checked=true)isfb=1;elseisfb=0;stringstr=insertintotb_test(testContent,testAns1,testAns2,testAns3,testAns4,rightAns,pub,testCourse)values(+txtsubject.Text.Trim()+,+txtAnsA.Text.Trim()+,+txtAnsB.Text.Trim()+,+txtAnsC.Text.Trim()+,+txtAnsD.Text.Trim()+,+rblRightAns.SelectedValue.ToString()+,+isfb+,+ddlkm.SelectedItem.Text+);BaseClass.OperateData(str);btnconcel_Click(sender,e);protectedvoidbtnconcel_Click(objectsender,EventArgse)txtsubject.Text=;txtAnsD.Text=;txtAnsC.Text=;txtAnsB.Text=;txtAnsA.Text=;,(4)數(shù)據(jù)庫(kù)連接代碼,addname=connstringconnectionString=DataSource=.;initialcatalog=Exam;UserID=sa;Password=123456,www.kasong-,www.youlvjing-,www.a-,www.a-,,ThankYou!,- 1.請(qǐng)仔細(xì)閱讀文檔,確保文檔完整性,對(duì)于不預(yù)覽、不比對(duì)內(nèi)容而直接下載帶來(lái)的問(wèn)題本站不予受理。
- 2.下載的文檔,不會(huì)出現(xiàn)我們的網(wǎng)址水印。
- 3、該文檔所得收入(下載+內(nèi)容+預(yù)覽)歸上傳者、原創(chuàng)作者;如果您是本文檔原作者,請(qǐng)點(diǎn)此認(rèn)領(lǐng)!既往收益都?xì)w您。
下載文檔到電腦,查找使用更方便
9.9 積分
下載 |
- 配套講稿:
如PPT文件的首頁(yè)顯示word圖標(biāo),表示該P(yáng)PT已包含配套word講稿。雙擊word圖標(biāo)可打開(kāi)word文檔。
- 特殊限制:
部分文檔作品中含有的國(guó)旗、國(guó)徽等圖片,僅作為作品整體效果示例展示,禁止商用。設(shè)計(jì)者僅對(duì)作品中獨(dú)創(chuàng)性部分享有著作權(quán)。
- 關(guān) 鍵 詞:
- 在線(xiàn)考試系統(tǒng)代碼 在線(xiàn) 考試 系統(tǒng) 代碼 PPT 課件
鏈接地址:http://m.italysoccerbets.com/p-12722842.html