⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 default.aspx.cs

📁 This I develops based on the B/S structure student managementsystem management system, hoped brings
💻 CS
字号:
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Data.SqlClient;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using System.Configuration;

namespace STGROUP
{
	/// <summary>
	/// ST_default 的摘要说明。
	/// </summary>
	public partial class ST_default : System.Web.UI.Page
	{
	
		protected void Page_Load(object sender, System.EventArgs e)
		{
			// 在此处放置用户代码以初始化页面
		}

		#region Web Form Designer generated code
		override protected void OnInit(EventArgs e)
		{
			//
			// CODEGEN:该调用是 ASP.NET Web 窗体设计器所必需的。
			//
			InitializeComponent();
			base.OnInit(e);
		}
		
		/// <summary>
		/// 设计器支持所需的方法 - 不要使用代码编辑器修改
		/// 此方法的内容。
		/// </summary>
		private void InitializeComponent()
		{    

		}
		#endregion

		protected void st_btn_enter_Click(object sender, System.EventArgs e)
		{
			string st_connstr= ConfigurationSettings.AppSettings["st_dbconn"];
			SqlConnection st_conn=new SqlConnection(st_connstr);	
			st_conn.Open();
			string st_sqlstr="select * from ST_users where ST_User_id='"+st_tbx_userid.Text+"'and ST_User_password='"+st_tbx_userpwd.Text+"'";
			SqlCommand st_comm=new SqlCommand(st_sqlstr,st_conn);
			SqlDataReader st_dreader=st_comm.ExecuteReader();
			if(st_dreader.Read())
			{   Session["User_id"]=st_dreader["ST_User_id"];
				Session["user_power"]=st_dreader["ST_User_power"];			
				if((int)Session["User_power"]==0)
				{
					Response.Redirect("ST_query.aspx");
				}
				else 
				{
					Response.Redirect("ST_student.aspx");
				}
			}
			else
			{
					st_lbl_note.Text="登录失败!";
			  }
			st_conn.Close();
		}

		
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -