How to change user password in a .NET application

Discussion in 'ASP .Net' started by =?ISO-8859-1?Q?Yannick_B=E9ot?=, Jun 16, 2005.

  1. Hi,

    I'm trying to make an application that allow a user, through a web form
    to change its password

    On a click event, here is the code

    DirectoryEntry usr = new DirectoryEntry(
    theUserDN,
    user,
    password, AuthenticationTypes.Secure);
    usr.Invoke(
    "ChangePassword",
    new object[]{password, newpassword} );

    where password is the current user password
    newpassword... the new password
    user, the login
    theUserDn, something like
    "LDAP://mydomaincontroller/CN=...,cn=users,DC=superheros,DC=com"


    I have got an exception :

    [COMException (0x8007202f): Une violation de contrainte s'est produite.]

    [TargetInvocationException: Une exception a été levée par la cible d'un
    appel.]
    System.RuntimeType.InvokeDispMethod(String name, BindingFlags
    invokeAttr, Object target, Object[] args, Boolean[] byrefModifiers,
    Int32 culture, String[] namedParameters) +0
    System.RuntimeType.InvokeMember(String name, BindingFlags
    invokeAttr, Binder binder, Object target, Object[] args,
    ParameterModifier[] modifiers, CultureInfo culture, String[]
    namedParameters) +473
    System.Type.InvokeMember(String name, BindingFlags invokeAttr,
    Binder binder, Object target, Object[] args) +29
    System.DirectoryServices.DirectoryEntry.Invoke(String methodName,
    Object[] args) +107
    clarins.u1_1.Button1_Click(Object sender, EventArgs e) +108
    System.Web.UI.WebControls.Button.OnClick(EventArgs e) +108

    System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String
    eventArgument) +57
    System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler
    sourceControl, String eventArgument) +18
    System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
    System.Web.UI.Page.ProcessRequestMain() +1277



    Do you have any idea?
    =?ISO-8859-1?Q?Yannick_B=E9ot?=, Jun 16, 2005
    #1
    1. Advertising

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. Ching Liang
    Replies:
    2
    Views:
    795
    Tommy
    Feb 24, 2004
  2. John Beard
    Replies:
    1
    Views:
    5,153
    thaya
    Sep 6, 2006
  3. Luqman
    Replies:
    5
    Views:
    849
  4. AAaron123
    Replies:
    2
    Views:
    2,105
    AAaron123
    Jan 16, 2009
  5. AAaron123
    Replies:
    1
    Views:
    1,321
    Oriane
    Jan 16, 2009
Loading...

Share This Page