我正在使用uCmerce与cms成员。对于忘记密码密码链接验证,我想要所需成员的最后密码更改日期,但它提供错误的日期作为当前日期时间值。
String userName = Membership.GetUserNameByEmail(email);
MembershipUser membershipUser = Membership.GetUser(userName);
if (membershipUser.LastPasswordChangedDate > date)
{
----- validation Where date is the datetime when user request forgot password request and link will sent to him
---- but all the time LastPasswordChangedDategetting current date time, so can not able to set the validation
}
任何想法?
由于
吉里什
答案 0 :(得分:0)
试过以下内容,似乎对我有用。你可以尝试以下方法:
string userName = Membership.GetUserNameByEmail(email);
MembershipUser membershipUser = Membership.GetUser(userName);
if (membershipUser != null && membershipUser.LastPasswordChangedDate.Date > DateTime.Now.Date)
{
// Do something
}