Setting passwordStrengthRegularExpression outside of web.config

Discussion in 'ASP .Net' started by kgray@tecolote.com, Jan 4, 2008.

  1. Guest

    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
     
    , Jan 4, 2008
    #1
    1. Advertisements

  2. Toze Guest

    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


    <> wrote in message
    news:...
    > 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
     
    Toze, Jan 6, 2008
    #2
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?RGFuaWVs?=

    Machine.config & web.config

    =?Utf-8?B?RGFuaWVs?=, Jan 18, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    13,966
    Hermit Dave
    Jan 18, 2004
  2. Hardy Wang
    Replies:
    2
    Views:
    1,642
    Joe Fallon
    Jul 31, 2004
  3. Timm
    Replies:
    16
    Views:
    691
    =?Utf-8?B?U3JlZWppdGggUmFt?=
    Oct 11, 2005
  4. Benny Ng
    Replies:
    9
    Views:
    10,887
    Benny Ng
    Oct 13, 2005
  5. barry
    Replies:
    0
    Views:
    1,581
    barry
    Jul 1, 2006
  6. CSharpner
    Replies:
    0
    Views:
    1,396
    CSharpner
    Apr 9, 2007
  7. Brett Ossman

    passwordstrengthregularexpression Question

    Brett Ossman, Mar 2, 2009, in forum: ASP .Net Security
    Replies:
    0
    Views:
    691
    Brett Ossman
    Mar 2, 2009
  8. Krzysztof Poc

    outside type, outside function

    Krzysztof Poc, Feb 3, 2012, in forum: C++
    Replies:
    1
    Views:
    464
    Victor Bazarov
    Feb 7, 2012
Loading...