我想重置当前用户密码并获取新密码。我是新手。我该如何解决这个问题?
我的代码:
public static string ResetCurrentUserPassword(string userName)
{
MembershipProvider p = (MembershipProvider)Membership.Providers["Default"];
MembershipUser obj = Membership.GetUser(userName);
return obj.ResetPassword();
}
网络配置:
<siteMap defaultProvider="SitefinitySiteMap">
<providers>
<add name="SitefinitySiteMap" type="Telerik.Sitefinity.Web.SitefinitySiteMap, Telerik.Sitefinity" enablePasswordReset="true" taxonomyProvider="OpenAccessDataProvider" pageTaxonomy="Pages" rootNode="FrontendSiteMap" pageProvider="OpenAccessDataProvider"/>
</providers>
</siteMap>
<roleManager enabled="false"/>
<membership defaultProvider="Default">
<providers>
<clear/>
<add name="Default" type="Telerik.Sitefinity.Security.Data.SitefinityMembershipProvider, Telerik.Sitefinity" enablePasswordReset="true"/>
</providers>
</membership>