📄 st_logonmodule.ascx.cs
字号:
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
public partial class ST_LogonModule :ST_ModuleBase
{
protected void Page_Load(object sender, EventArgs e)
{
if (!this.IsPostBack)
{
if (HttpContext.Current.User.Identity.IsAuthenticated)
{
string ST_UserName = HttpContext.Current.User.Identity.Name;
this.lalInfo.Text = "<b><font color='red'>" + ST_UserName + "</font></b>,使用本系统!";
this.lalInfo.Style["color"] = "Green";
}
else
{
this.lalInfo.Text = "你还没有登陆,登陆后可使用各项服务";
this.lalInfo.Style["color"] = "Red";
}
}
}
protected void btbLogon_Click(object sender, EventArgs e)
{
if (Authenticate(this.txtUserName.Text.ToString(), this.txtUserPwd.Text.ToString()) == true)
{
FormsAuthentication.SetAuthCookie(this.txtUserName.Text.ToString(),false);
//FormsAuthentication.RedirectFromLoginPage(this.txtUserName.Text.ToString(), false);
//this.Label1.Text = "asdfasdfasdfasdfffffffffffffff";
//Response.Redirect(PathPrefix + "/ST_RCategoryMan.aspx");
Response.Redirect("ST_RCategoryMan.aspx");
}
else
{
this.lalInfo.Text = "用户名或密码错误";
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -