Setting passwordStrengthRegularExpression outside of web.config

  • Thread starter Thread starter kgray
  • Start date Start date
K

kgray

Is there anyway to set PasswordStrengthRegularExpressionon your
membership provider, without changing the web.config? I would like to
offer the user the ability to change the strength requirement for
their site, but I don't want to do it through the web.config file.
Yet, when I try membership.PasswordStrengthRegularExpression, it is
read-only.

I have found that with appsettings in the web.config, you can create a
seperate file, and set the appsettings to pull that info, ie:
<appSettings file="cfg.xml">. But, the membership provider doesn't
have this option.

Does anyone have any suggestions on how to achieve this?

Thanks in advance, Kathy
 
membership works with providers
so you could create a provider that inherits from the sqlMembbership
provider ( or the provider your using)

create a method in your class that change with reflection the field that
olds PasswordStrengthRegularExpression, change in the web config the the
type of the membership provider to your class
and when you need to change the PasswordStrengthRegularExpression cast the
membership provider to your class and call your method

sorry my bad english
 
Back
Top