以编程方式重置成员资格密码 [英] reset the membership password Programmatically

查看:105
本文介绍了以编程方式重置成员资格密码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何以编程方式验证当前密码,然后使用会员资格中的新密码进行更改?

以及如何在忘记时重置密码并使用重置链接发送电子邮件?

How can I programmatically validate the current password then change it with the new password in membership ?
and how can i reset the password when forgotten and send email with the reset link ?

推荐答案

使用 ChangePassword 来自 MembershipUser 类的方法。



Use ChangePassword Method from MembershipUser class.

var user = Membership.GetUser("user name");
user.ChangePassword("old Password","New Password");





http://msdn.microsoft.com/en-IN/library/system。 web.security.membershipuser.changepassword.aspx [ ^ ]


这篇关于以编程方式重置成员资格密码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆