net2.0 How to modify the resolution of a user's password

Source: Internet
Author: User
Solve

In net2.0 Memebershipuser class has a ChangePassword method, but he has two parameters, old password and new password, but the problem is ah, how do I know the user's old password ah, if I do as an administrator to modify the user password, the solution is as follows, first to the user Resetpasswo RD Code:

MembershipUser user = Membership.getuser (txtFindUserName.Text.ToString (). Trim ());
User. Unlockuser ();
String oldpass = user. ResetPassword ();
String newpass = TxtFindUserPass.Text.ToString (). Trim ();
if (Newpass.length < 6)
{
Return
}
User. ChangePassword (Oldpass,newpass);



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.