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
最新评论共有 0 位网友发表了评论
查看所有评论
发表评论
热点关注

