?? st_logonmodule.ascx.cs
字號(hào):
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 的摘要說(shuō)明。
/// </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;
ShowMsg.Text="<b><font color='red'>"+ST_UserName+"</font></b>,歡迎您使用本系統(tǒng)!";
ShowMsg.Style["color"]="Green";
}
else{
ShowMsg.Text="您還未登錄本系統(tǒng),登錄后才可使用各項(xiàng)服務(wù)";
ShowMsg.Style["color"]="Red";
}
}
#region Web 窗體設(shè)計(jì)器生成的代碼
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: 該調(diào)用是 ASP.NET Web 窗體設(shè)計(jì)器所必需的。
//
InitializeComponent();
base.OnInit(e);
}
/// <summary>
/// 設(shè)計(jì)器支持所需的方法 - 不要使用代碼編輯器
/// 修改此方法的內(nèi)容。
/// </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;
}
}
}
}
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -