Backup1/Utilities/UserController.cs
(开头部分) 3KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
using System;
using System.Web;
using System.Web.Security;
using ElfinNet.BLL;
using ElfinNet.Model;
namespace ElfinNet.Web.Utilities
{
//该源码下载自www.51aspx.com(51aspx.com)
/// <summary>
/// Summary description for AccountController.
/// </summary>
public class UserController
{
private const string User_KEY = "User_KEY";
private const string URL_DEFAULT = "Default.aspx";
private const string URL_SIGNIN = "SignIn.aspx";
private const string URL_ACCOUNTCREATE = "MyAccount.aspx?action=create";
private const string URL_ACCOUNTSIGNIN = "MyAccount.aspx?action=signIn";
private const string URL_ACCOUNTUPDATE = "MyAccount.aspx?action=update";
public UserController()
{
//
// TODO: Add constructor logic here
//
}
#region Login
/// <summary>
/// Process Login process
/// User passes in a user name and password and will be redirected on if successful
/// </summary>
/// <param name="userId">User name the customer is authenticating with</param>
/// <param name="password">Password the customer is using</param>
/// <returns>true if the login is successful</returns>
public bool ProcessLogin(string userName, string password)
{
UserInfo oUserInfo = VerifyLogin(userName,password);
//If login is successful then store the state in session and redirect
if (oUserInfo!=null)
{
HttpContext.Current.Session[User_KEY] = oUserInfo;
// Determine where to redirect the user back too
// If they came in from the home page, take them to a similar page
if (FormsAuthentication.GetRedirectUrl(userName, false).EndsWith(URL_DEFAULT))
{
FormsAuthentication.SetAuthCookie(userName, false);
HttpContext.Current.Response.Redirect(URL_ACCOUNTSIGNIN, true);
}
else
{
// Take the customer back to where the came from
FormsAuthentication.SetAuthCookie(userName, false);
HttpContext.Current.Response.Redirect(FormsAuthentication.GetRedirectUrl(userName, false), true);
}
return true;
}
else
后面还有 78 行代码,解锁后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。