RSS
热门关键字:
当前位置 :| 主页>教你一招>

C#程序改win2000admin888

来源:不详 作者: 时间:2003-03-06 Tag: 点击:

  Windows 2000 is available in the market in four flavours,you can get detail from www.microsoft.com home page.
  Following is a code fragment that can be used to change the password of the system. This program is in C sharp and requires C sharp compiler i.e csc.exe
  
  This is a console based program, No need to visually compile it...Just rename the file somename.cs and compile.
  
  It's fun to run this code ! Enjoy...
  
  // 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();
  
  }
  }
  

最新评论共有 0 位网友发表了评论
发表评论
评论内容:不能超过250字,需审核,请自觉遵守互联网相关政策法规。
用户名: 密码:
匿名?
注册