login.aspx.cs
来自「用AJAX做的一个在线求职系统」· CS 代码 · 共 27 行
CS
27 行
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 + =
减小字号Ctrl + -
显示快捷键?