110,571
社区成员
发帖
与我相关
我的任务
分享
public partial class Chklogin : BasePage
{
protected void Page_Load(object sender, System.EventArgs e)
{
if (Session["validateNum"] == null || !Session["validateNum"].ToString().Equals(Request["verifyCode"].ToString()))
{
Response.Write("<script>alert('附加码不正确。');history.go(-1);</script>");
Response.End();
}
else
{
UserActions Ua = new UserActions();
//s1=(FormsAuthentication.HashPasswordForStoringInConfigFile(Request.Form["password"].ToString().Trim(),"MD5"));
//string pwd=s1.Substring(8,s1.Length-16);
string Pwd = PubRequest.GetRequestString( "password" );
string UserName = PubRequest.GetRequestString( "username" );
string UserIDValue = Ua.GetUserLoginRetValue(UserName, Pwd);
if (UserIDValue != "")
{
#region "登陆后的处理"
//LoginLogFactory.DeleteLoginLog(myRequest.GetIP());
//UserCreditsFactory.UpdateUserCredits(uid);
int SelectPwd = -1;
int SelectUserName = -1;
if (PubRequest.GetRequestString("checkbox1") == "1")
{
SelectPwd = 1;
}
if (PubRequest.GetRequestString("chk1") == "2")
{
SelectUserName = 1;
}
UserUtil.WriteUserCookie(Int64.Parse(UserIDValue), SelectPwd, SelectUserName);//Utils.StrToIntDef(PubRequest.GetRequestString("expires"), -1)
//Response.Redirect(UserUtil.GetReUrl());//"userEdit.aspx"
DataSet Ds = UserActions.GetUserDetailByLogID(UserName);
if (Ds != null && Ds.Tables.Count > 0 && Ds.Tables[0].Rows.Count == 1)
{
DataRow Dr = Ds.Tables[0].Rows[0];
string ErrString = null;
int StrLoginCount = Convert.ToInt32(Dr["LoginCount"].ToString()) + 1;
string UpdateParentPostStatus = string.Format("update UserActiveInfo set LastLoginTime = '{0}',LastLoginIP='" + Request.UserHostAddress + "',LoginCount='" + StrLoginCount + "' where LoginID = {1} ", DateTime.Now.ToString(), UserName);
int OptValue = DbExecuter.ExecuteNonQuerySQL(UpdateParentPostStatus, ref ErrString);
PubFuncs.RaiseExceptionWhenTrue(OptValue <= 0, ErrString);
}
Response.Redirect("userCenter.aspx");//"userEdit.aspx"
//OnlineUserFactory.UpdateAction(olid, UserAction.Login.ActionID, 0, config.Onlinetimeout);
//UserFactory.UpdateUserLastvisit(int.Parse(userIDValue), myRequest.GetIP());
//updateJifen(userIDValue);
#endregion
}
else
{
//ClientScriptManager Csm = Page.ClientScript();
//PubFuncs.ResponseScript("history.go(-1);", Csm);
PubFuncs.ShowMessage("错误提示", "用户名密码错误或者该帐户已经被锁定。", true, "login.aspx");
}
}
}
}
}