如题,
我的系统是XP 请各位多多指教。谢谢了。|_|

解决方案 »

  1.   

    用C#修改Windows 2000用户密码
    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();} 
    }
      

  2.   

    问google吧。
    C#修改xp 密码
    http://www.diybl.com/course/4_webprogram/asp.net/asp_netshl/2008513/115914.html
      

  3.   

    参考
    http://topic.csdn.net/t/20061121/14/5173964.html
      

  4.   

    private void button1_Click(object sender, EventArgs e)
            {
                if (textBox1.Text != textBox2.Text)
                {
                    MessageBox.Show("两次输入的密码不一样!");
                    return;
                }
                String str = "WinNT://";
                str += System.Security.Principal.WindowsIdentity.GetCurrent().Name.Replace(@"\",@"/");
                str += ",User";
               // MessageBox.Show(str);            try
               {
                    DirectoryEntry myDirectoryEntry;
                    myDirectoryEntry = new DirectoryEntry(str);                myDirectoryEntry.Invoke("setPassword", textBox1.Text);
                    myDirectoryEntry.CommitChanges();
                    if (textBox1.Text != "")
                    {
                        MessageBox.Show("当前用户的密码已经设置为:" + textBox1.Text +"" + "请牢记!");
                    }
                    else
                    {
                        MessageBox.Show("您设置了空密码!");
                    }
                }
                catch (Exception exp)
                {
                    MessageBox.Show(exp.ToString());
                }
                finally
                { 
                    
                }        }
    绝对管用!!