2

我正在使用 uCommerce 和 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

}

任何想法?

谢谢

吉里什

4

1 回答 1

0

刚刚尝试了以下方法,它似乎对我有用。您可以尝试以下方法:

string userName = Membership.GetUserNameByEmail(email);
MembershipUser membershipUser = Membership.GetUser(userName);

if (membershipUser != null && membershipUser.LastPasswordChangedDate.Date > DateTime.Now.Date)
{
    // Do something
}
于 2014-11-06T23:39:05.827 回答