資源簡介
能夠完成一個獨立的網站建設,有關學校信息的建設。

代碼片段和文件信息
using?System;
using?System.Configuration;
using?System.Data;
using?System.Linq;
using?System.Web;
using?System.Web.Security;
using?System.Web.UI;
using?System.Web.UI.HtmlControls;
using?System.Web.UI.WebControls;
using?System.Web.UI.WebControls.WebParts;
using?System.xml.Linq;
using?System.Collections.Generic;
using?System.Data.SqlClient;
public?partial?class?_Default?:?System.Web.UI.Page
{
????protected?void?Page_Load(object?sender?EventArgs?e)
????{
????}
????protected?void?Button2_Click(object?sender?EventArgs?e)
????{
????????Response.Redirect(“~/Students/StudentRegister.aspx“);
????}
????protected?void?loginButton_Click(object?sender?EventArgs?e)
????{
????????if?(this.DropDownListUserType.SelectedValue?!=?“null“)
????????{
????????????//獲取用戶輸入的信息
????????????string?userType?=?this.DropDownListUserType.SelectedValue.ToString();
????????????string?userName?=?this.TextBoxUserName.Text;
????????????string?userPassword?=?this.TextBoxUserPassword.Text;
????????????//定義用來判斷查詢結果的變量
????????????Boolean?isExist?=?false;
????????????string?sql?=?““;
????????????//定義保存操作參數的集合
????????????List?cmdpara?=?new?List();
????????????if?(userType?==?“2“) //學生登錄
????????????{
????????????????//利用學生編號在學生表內查詢,判斷是否存在此學生
????????????????sql?=?“SELECT?stuID?FROM?Student?WHERE?stuID=@stuID“;
????????????????//初始化相關變量
????????????????isExist?=?false;
????????????????cmdpara.Clear();
????????????????//向集合內添加需要的參數
????????????????cmdpara.Add(commDBHelper.CreateParameters(“@stuID“?DbType.String?userName));
????????????????commDBHelper.ExecuteReader(sql?CommandType.Text?out?isExist?cmdpara);
????????????????if?(isExist)
????????????????{
????????????????????//存在此用戶,繼續判斷密碼是否正確
????????????????????sql?=?“SELECT?stuIDstuName?FROM?Student?WHERE?stuID=@stuID?and? stuPassword=@stuPassword“;
????????????????????//初始化相關變量
????????????????????isExist?=?false;
????????????????????cmdpara.Clear();
????????????????????//向集合內添加需要的參數
????????????????????cmdpara.Add(commDBHelper.CreateParameters(“@stuName“?DbType.String?userName));
????????????????????cmdpara.Add(commDBHelper.CreateParameters(“@stuPassword“?DbType.String?commTools.toMD5(userPassword)));
????????????????????DataRow?row?=?commDBHelper.ExecuteReader(sql?CommandType.Text?out?isExist?cmdpara);
????????????????????if?(isExist)
????????????????????{
????????????????????????//用戶名和密碼正確,則利用Sessiion對象保存用戶的狀態
????????????????????????Session[“userName“]?=?row[“stuName“];
????????????????????????Session[“userID“]?=?row[“stuID“];
????????????????????????Session[“userType“]?=?“2“;
????????????????????????Session[“userLogin“]?=?true;
????????????????????????//利用Response.Redirect方法調轉到用戶子系統中的某頁面
????????????????????????Response.Redirect(“~/students/StuSearchScore.aspx?“);
????????????????????}
????????????????????else
????????????????????{
????????????????????????//密碼輸入問題
????????????????????????commTools.alert(this?
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2015-05-16?10:59??楊慧?40\
?????目錄???????????0??2015-05-06?14:13??楊慧?40\SMS數據庫\
?????文件????????1051??2015-05-06?15:03??楊慧?40\SMS數據庫\delete.sql
?????文件????????1052??2015-05-06?15:02??楊慧?40\SMS數據庫\insert.sql
?????文件?????3145728??2015-05-09?11:27??楊慧?40\SMS數據庫\SMS.mdf
?????文件?????1048576??2015-05-09?11:27??楊慧?40\SMS數據庫\SMS_log.ldf
?????文件????????8192??2015-05-06?17:12??楊慧?40\SMS數據庫\Solution1.sqlsuo
?????文件?????????466??2015-05-06?17:09??楊慧?40\SMS數據庫\Solution1.ssmssln
?????文件????????1052??2015-05-06?15:04??楊慧?40\SMS數據庫\SQLQuery3.sql
?????文件????????1051??2015-05-06?15:04??楊慧?40\SMS數據庫\SQLQuery4.sql
?????文件????????1259??2015-05-06?17:09??楊慧?40\SMS數據庫\SQLQuery5.sql
?????文件????????1257??2015-05-06?15:09??楊慧?40\SMS數據庫\SQLQuery6.sql
?????文件?????1666510??2015-05-25?22:09??楊慧?40\學生成績管理系統-(楊慧?40).doc
?????目錄???????????0??2015-05-16?11:26??楊慧?40\學生管理系統(楊慧?40)\
?????目錄???????????0??2015-05-16?11:26??楊慧?40\學生管理系統(楊慧?40)\Admin\
?????文件????????2724??2015-05-06?16:35??楊慧?40\學生管理系統(楊慧?40)\Admin\adminMasterPage.master
?????文件?????????472??2015-05-06?15:35??楊慧?40\學生管理系統(楊慧?40)\Admin\adminMasterPage.master.cs
?????文件???????11226??2015-05-16?09:13??楊慧?40\學生管理系統(楊慧?40)\Admin\course.aspx
?????文件????????1628??2015-05-16?09:12??楊慧?40\學生管理系統(楊慧?40)\Admin\course.aspx.cs
?????文件???????17067??2015-05-16?11:24??楊慧?40\學生管理系統(楊慧?40)\Admin\teacher.aspx
?????文件????????4618??2015-05-16?10:46??楊慧?40\學生管理系統(楊慧?40)\Admin\teacher.aspx.cs
?????目錄???????????0??2015-05-16?11:26??楊慧?40\學生管理系統(楊慧?40)\App_Code\
?????文件????????9070??2015-05-06?15:15??楊慧?40\學生管理系統(楊慧?40)\App_Code\commDBHelper.cs
?????文件????????1409??2015-05-09?11:05??楊慧?40\學生管理系統(楊慧?40)\App_Code\commTools.cs
?????目錄???????????0??2015-05-16?11:26??楊慧?40\學生管理系統(楊慧?40)\App_Data\
?????目錄???????????0??2015-05-16?11:26??楊慧?40\學生管理系統(楊慧?40)\App_Themes\
?????目錄???????????0??2015-05-16?11:26??楊慧?40\學生管理系統(楊慧?40)\App_Themes\主題1\
?????文件?????????437??2015-05-06?17:14??楊慧?40\學生管理系統(楊慧?40)\App_Themes\主題1\st
?????目錄???????????0??2015-05-16?11:26??楊慧?40\學生管理系統(楊慧?40)\App_Themes\主題2\
?????文件????????4040??2015-05-19?21:47??楊慧?40\學生管理系統(楊慧?40)\Default.aspx
?????文件????????6598??2015-05-09?11:06??楊慧?40\學生管理系統(楊慧?40)\Default.aspx.cs
............此處省略17個文件信息
評論
共有 條評論