> I want to write a ASPX C# to change the password of a user account on
> standalone computer,
[quoted text clipped - 15 lines]
> webmaster.")
> End If
To access WinNT provider intetrface you should use
System.DirectoryServices namespace
using System.DirectoryServices;
DirectoryEntry myDirectoryEntry;
myDirectoryEntry = new DirectoryEntry(@"WinNT://" + ServerName + "/" +
UserName + ",User");
myDirectoryEntry.Invoke("setPassword", NewPwd);
myDirectoryEntry.CommitChanges();
LamSoft - 06 Jun 2007 08:55 GMT
May I know how to know the return code?
Thank you
>> I want to write a ASPX C# to change the password of a user account on
>> standalone computer,
[quoted text clipped - 29 lines]
> myDirectoryEntry.Invoke("setPassword", NewPwd);
> myDirectoryEntry.CommitChanges();
Alexey Smirnov - 06 Jun 2007 09:20 GMT
> May I know how to know the return code?
>
[quoted text clipped - 33 lines]
>
> - Show quoted text -
You should catch an exception
try
{
myDirectoryEntry = new DirectoryEntry(@"WinNT://" + ServerName + "/"
+
UserName + ",User");
myDirectoryEntry.Invoke("setPassword", NewPwd);
myDirectoryEntry.CommitChanges();
}
catch (Exception e)
{
OutMsg("Unexpected Error: " & e.ToString() & ", Please contact the
webmaster.");
return;
}
LamSoft - 06 Jun 2007 09:40 GMT
Thanks a lot
>> May I know how to know the return code?
>>
[quoted text clipped - 52 lines]
> return;
> }