change the asp.net user password while retrieving current password
I'm using the ChangePassword
method of membership provider to change the password and one of the requirement before calling the ChangePassword
is to retrieve the current password. But I'm getting error:
padding is invalid and cannot be removed
below is my web.config:
<system.web>
< machineKey validationKey="4FD671E39167DFB91A918018007D095E50B7D2971B01AEDE26A7233FD9CC4A470F80689997EC2C7BB515F9D82C8B4D1F3A8495193630B11E8401C96BD0A5A133"
decryptionKey="ED1555E75C7B91738172E0086456C70B9开发者_开发百科CAA4C44214FC2B1907123993EA4FA53"
validation="SHA1"
decryption="AES"/>
....
< /system.web>
You cheat, you reset the password to a known value first.
MembershipUser user = Membership.GetUser();
string generated = user.ResetPassword();
user.ChangePassword(generated, *newPassword*);
精彩评论