By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,269 Members | 1,509 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,269 IT Pros & Developers. It's quick & easy.

How to change user password in a .NET application

P: n/a
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(Str ing 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.IPo stBackEventHandler.RaisePostBackEvent(String
eventArgument) +57
System.Web.UI.Page.RaisePostBackEvent(IPostBackEve ntHandler
sourceControl, String eventArgument) +18
System.Web.UI.Page.RaisePostBackEvent(NameValueCol lection postData) +33
System.Web.UI.Page.ProcessRequestMain() +1277

Do you have any idea?
Nov 19 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.