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

📄 st_logonmodule.ascx.cs

📁 这是一个酒店管理系统
💻 CS
字号:
namespace ST_GROUP.Modules
{
	using System;
	using System.Data;
	using System.Drawing;
	using System.Web;
	using System.Web.UI.WebControls;
	using System.Web.UI.HtmlControls;
	using System.Web.Security;

	/// <summary>
	///		ST_LogonModule 的摘要说明。
	/// </summary>
	public partial class ST_LogonModule : ST_ModuleBase
	{

		private void Page_Load(object sender, System.EventArgs e)
		{   
			if(HttpContext.Current.User.Identity.IsAuthenticated)
			{
				String ST_UserName=HttpContext.Current.User.Identity.Name;
                                Panel1.Visible = false;
                                ImageAmu.Visible = true;
                                LoginButton.Visible = false;
				ShowMsg.Text="<b><font color='red'>"+ST_UserName+"</font></b>,欢迎您使用本系统!";
				ShowMsg.Style["color"]="Green";
			}
			else{
                                Panel1.Visible = true;
                                ImageAmu.Visible = false;
                                LoginButton.Visible = true;
				ShowMsg.Text="您还未登录本系统,登录后才可使用各项服务";
				ShowMsg.Style["color"]="Red";
			}
		}

		#region Web 窗体设计器生成的代码
		override protected void OnInit(EventArgs e)
		{
			//
			// CODEGEN: 该调用是 ASP.NET Web 窗体设计器所必需的。
			//
			InitializeComponent();
			base.OnInit(e);
		}
		
		/// <summary>
		///		设计器支持所需的方法 - 不要使用代码编辑器
		///		修改此方法的内容。
		/// </summary>
		private void InitializeComponent()
		{
			this.LoginButton.Click += new System.EventHandler(this.LogonButton_Click);
			this.Load += new System.EventHandler(this.Page_Load);

		}
		#endregion

		private void LogonButton_Click(object sender, System.EventArgs e)
		{
			if(Authenticate(LogonNameTextBox.Text.Trim() ,LogonPasswordTextBox.Text.Trim())==true)
			{
                FormsAuthentication.SetAuthCookie(LogonNameTextBox.Text.Trim(),true);
               
				Response.Redirect(PathPrefix+"/ST_default.aspx");
          
			}
			else
			{  
                MismatchLabel.Visible=true;
			}
		}
        protected void LoginButton_Click(object sender, EventArgs e)
        {

        }
}
}

⌨️ 快捷键说明

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