我在web.config中声明了多个成员资格提供程序
<membership userIsOnlineTimeWindow="15" defaultProvider="UmbracoMembershipProvider">
<providers>
<clear />
<add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider" connectionStringName="ApplicationServices" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="false" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10" applicationName="/" />
<add name="UmbracoMembershipProvider" type="umbraco.providers.members.UmbracoMembershipProvider" enablePasswordRetrieval="false" enablePasswordReset="false" requiresQuestionAndAnswer="false" defaultMemberTypeAlias="Another Type" passwordFormat="Hashed" />
<add name="Reset_Pass" connectionStringName="AspNetDB" applicationName="/" enablePasswordReset="true" enablePasswordRetrieval="false" maxInvalidPasswordAttempts="100000" minRequiredPasswordLength="5" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="100000" passwordStrengthRegularExpression="" passwordFormat="Hashed" requiresQuestionAndAnswer="false" requiresUniqueEmail="false" type="SiteMemberShipProvider" />
</providers>
</membership>
但是当我跟注时,会员资格被分配默认提供商的价值。
public static MembershipUser GetUserInfoByUserName(string username)
{
MembershipUser user = Membership.GetUser(username);
return user;
}
当我监视Membership值的值时,它设置defaultProvider的值
如何将成员资格提供程序值更改为“AspNetSqlMembershipProvider”。