Wednesday, March 4, 2009

C# & SQL Server | Default password settings

Problema: Nas password usadas pelo Visual Studio (Base de Dados SQL Server) são usadas por defeito passwords com sete caracteres, havendo obrigatoriedade de usar um carácter especial (underscore, “arroba”, etc.).

Solução: Para dar a volta a esta questão pode-se alterar o Web.config, adicionando-lhe o código que manipula, entre outros, o campo de password.
<membership defaultProvider="AspNetSqlMembershipProvider">
<providers>
<remove name="AspNetSqlMembershipProvider"/>
<add
name="AspNetSqlMembershipProvider"
type="System.Web.Security.SqlMembershipProvider,System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
connectionStringName="LocalSqlServer" enablePasswordRetrieval="false"
enablePasswordReset="true" requiresQuestionAndAnswer="true"
applicationName="/xxxr" requiresUniqueEmail="true"
minRequiredPasswordLength="4"
minRequiredNonalphanumericCharacters="0"
passwordFormat="Hashed" maxInvalidPasswordAttempts="3"
passwordAttemptWindow="10" passwordStrengthRegularExpression=""/>
</providers>
</membership>

Fonte:
http://www.thescripts.com/forum/thread572204.html

No comments:

Post a Comment