📄 login.aspx.cs
字号:
using System;
using System.Data;
using System.Configuration;
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 login_aspx : Page
{
protected void Login1_Authenticate(object sender, AuthenticateEventArgs e)
{
//使用Membership静态类进行成员身份验证
if (Membership.ValidateUser(Login1.UserName, Login1.Password))
{
//使用FormsAuthentication类的SetAuthCookie方法,将用户名存储于Cookies中,并根据在Login
//控件中的选择决定是否使用持久性cookie
FormsAuthentication.SetAuthCookie(Login1.UserName, Login1.RememberMeSet);
//返回到请求的页面的URL.
Response.Redirect(FormsAuthentication.GetRedirectUrl(Login1.UserName, Login1.RememberMeSet));
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -