MySql .net connector Membership Provider defaulting MinRequiredNonAlphanumericCharacters
I just downloaded and installed the most recent开发者_如何学Python MySQL .net connector, 6.3.6 and it connects to the DB just fine. My problem is with the web.config settings I have set for it. It seems that the MinRequiredNonAlphanumericCharacters property is hard coded to '1'.
I've changed this to 0, 5, or any other number. I even setup a web page to just display the properties of the provider. If I change the values in the web.config, the values update. It seems that MinRequiredNonAlphanumericCharacters won't change.
<membership defaultProvider="MySqlMembershipProvider">
<providers>
<clear/>
<add name="MySqlMembershipProvider" autogenerateschema="true" connectionStringName="LocalMySqlServer"
type="MySql.Web.Security.MySQLMembershipProvider, MySql.Web, Version=6.3.6.0, Culture=neutral, PublicKeyToken=C5687FC88969C44D"
applicationName="MySite"
maxInvalidPasswordAttempts="3"
enablePasswordReset="true"
enablePasswordRetrieval="false"
requiresQuestionAndAnswer="true"
requiresUniqueEmail="true"
passwordFormat="Hashed"
passwordAttemptWindow="10"
minRequiredNonAlphanumericCharacters="0"
minRequiredPasswordLength="44"/>
</providers>
</membership>
Again, the DB connection works just fine, reason I did not post the connection string. The min password length at 44 was just for testing.
protected void Page_Load(object sender, EventArgs e)
{
MembershipProvider p = Membership.Provider;
Literal1.Text = "Min Pass length: " + p.MinRequiredPasswordLength.ToString() +
"<br/> Required non-alpha: " + p.MinRequiredNonAlphanumericCharacters.ToString() +
"<br/>App Name: " + p.ApplicationName;
}
Of the three I only tested, only MinRequiredNonAlphanumericCharacters stays at '1' no matter what I change it to in the web.config. I even changed it to 'abcd' and received no .NET runtime errors. Me thinks it is hard coded some where or I'm not using the right property name in the web.config. I copied the web.config value straight from and example in the documentation that came with the MySQL .net connector.
Any help will be appreciated.
Found answer to my post at www.asp.net. The property for minRequiredNonAlphanumericCharacters in my web.config file was wrong. Needed to be minRequiredNonalphanumericCharacters (small 'a').
精彩评论