用C#修改Windows 2000用户密码open in new window

实现

// Programming in C#

using System;
using System.DirectoryServices;
public class MyChangePasswordExample
{
    public static void Main(string[] args)
    {
        DirectoryEntry myDirectoryEntry;
        myDirectoryEntry = new DirectoryEntry (@"WinNT://yourdirectoryserver/TheUsername,User");
        myDirectoryEntry.Invoke("setPassword","NewPassword");
        myDirectoryEntry.CommitChanges();
    }
}

posted on 2004-03-24 13:37 木头象 阅读(2545) 评论(4)

Contributors: FHL