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

📄 denglu.aspx.cs

📁 简易BBS源码,包括系统管理、论坛管理、用户可以看懂源码
💻 CS
字号:
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
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.Data.SqlClient;

namespace free.admin
{
	/// <summary>
	/// Summary description for denglu.
	/// </summary>
	public partial class denglu : System.Web.UI.Page
	{
		protected System.Web.UI.WebControls.Label liu;
	
		protected void Page_Load(object sender, System.EventArgs e)
		{
			cuowu.Visible=false;
		}


		#region Web Form Designer generated code
		override protected void OnInit(EventArgs e)
		{
			//
			// CODEGEN: This call is required by the ASP.NET Web Form Designer.
			//
			InitializeComponent();
			base.OnInit(e);
		}
		
		/// <summary>
		/// Required method for Designer support - do not modify
		/// the contents of this method with the code editor.
		/// </summary>
		private void InitializeComponent()
		{    

		}
		#endregion

		protected void queding_ServerClick(object sender, System.EventArgs e)
		{
			if(yonghuming.Value=="")
			{
				cuowu.Visible=true;
				cuowu.Text="请输入您用户名";
			}
			else if(yonghumima.Value=="")
			{
				cuowu.Visible=true;
				cuowu.Text="请输入您的密码";
			}
			else
			{
				SqlConnection monn=new SqlConnection(Session["str_connection"].ToString());
				monn.Open();
				string mysql="select * from admin where yonghuming=@yonghuming and yonghumima=@yonghumima  ";
				SqlCommand mycommand=new SqlCommand(mysql,monn);
				mycommand.Parameters.Add(new SqlParameter("@yonghuming", SqlDbType.Char, 20));
				mycommand.Parameters["@yonghuming"].Value=yonghuming.Value.ToString();
				mycommand.Parameters.Add(new SqlParameter("@yonghumima", SqlDbType.Char, 20));
				mycommand.Parameters["@yonghumima"].Value=yonghumima.Value.ToString();
				try
				{
					SqlDataReader reader=mycommand.ExecuteReader();
					reader.Read();
					Session["free_quanxian"]=reader.GetString(2).ToString().Trim();
					Session["free_admin"]=reader.GetString(0).ToString().Trim();
					Response.Redirect("default.aspx");
					reader.Close();
					monn.Close();
				
//					else
//					{
						//cuowu.Visible=true;
						//cuowu.Text="您的密码输入有误!!";
						yonghumima.Value="";
//					}
				}
				catch
				{
					Response.Write("<script>alert('您无权使用!!')</script>");
				}
			}
		}
	}
}

⌨️ 快捷键说明

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