您目前尚未登陆,请选择【登陆】或【注册
首页->其他源码->某大学学生管理系统(毕业设计)源码>>default.aspx.cs>>源码在线查看
温馨提示:代码在线浏览功能只能做为源码浏览参考,如果想更进一步了解该代码请下载:某大学学生管理系统(毕业设计)源码
当前文件:文件类型 StudentsInfo/default.aspx.cs打开代码结构图
普通视图
		            
1using System; 2using System.Collections; 3using System.ComponentModel; 4using System.Data; 5using System.Data.SqlClient; 6using System.Drawing; 7using System.Web; 8using System.Web.SessionState; 9using System.Web.UI; 10using System.Web.UI.WebControls; 11using System.Web.UI.HtmlControls; 12using System.Configuration; 13 14namespace STGROUP 15{ 16 /// <summary> 17 /// ST_default 的摘要说明。 18 /// </summary> 19 public class ST_default : System.Web.UI.Page 20 { 21 protected System.Web.UI.WebControls.Button st_btn_enter; 22 protected System.Web.UI.WebControls.TextBox st_tbx_userid; 23 protected System.Web.UI.WebControls.TextBox st_tbx_userpwd; 24 protected System.Web.UI.WebControls.Label st_lbl_note; 25 26 private void Page_Load(object sender, System.EventArgs e) 27 { 28 // 在此处放置用户代码以初始化页面 29 } 30 31 Web Form Designer generated code 52 53 private void st_btn_enter_Click(object sender, System.EventArgs e) 54 { 55 string st_connstr= ConfigurationSettings.AppSettings["st_dbconn"]; 56 SqlConnection st_conn=new SqlConnection(st_connstr); 57 st_conn.Open(); 58 string st_sqlstr="select * from ST_users where ST_User_id='"+st_tbx_userid.Text+"'and ST_User_password='"+st_tbx_userpwd.Text+"'"; 59 SqlCommand st_comm=new SqlCommand(st_sqlstr,st_conn); 60 SqlDataReader st_dreader=st_comm.ExecuteReader(); 61 if(st_dreader.Read()) 62 { Session["User_id"]=st_dreader["ST_User_id"]; 63 Session["user_power"]=st_dreader["ST_User_power"]; 64 if((int)Session["User_power"]==0) 65 { 66 Response.Redirect("ST_query.aspx"); 67 } 68 else 69 { 70 Response.Redirect("ST_student.aspx"); 71 } 72 } 73 else 74 { 75 st_lbl_note.Text="登录失败!"; 76 } 77 st_conn.Close(); 78 } 79 80 81 } 82} 83
还没有找到您心仪的内容?请用.net源码大搜捕
代码片断 打包下载该项目完整源码:某大学学生管理系统(毕业设计)源码
51Aspx.com 版权所有 CopyRight © 2000-2008. 京ICP备06046876号