try something like (did not test, so do not know if it works)using System.DirectoryServices;
using System.Runtime.InteropServices;
using System;string strNodeName = "YourUserNameToDelete";
DirectoryEntry User;DirectoryEntry AD = new DirectoryEntry("WinNT://" + Environment.MachineName + ",computer", ".\\administrator", "adminPasswor");try
{
User = AD.Children.Find(strNodeName, "User");
AD.Children.Remove(User);
}
catch(COMException cex)
{
Console.WriteLine(cex.Message);
}AD.Close();
using System.Runtime.InteropServices;
using System;string strNodeName = "YourUserNameToDelete";
DirectoryEntry User;DirectoryEntry AD = new DirectoryEntry("WinNT://" + Environment.MachineName + ",computer", ".\\administrator", "adminPasswor");try
{
User = AD.Children.Find(strNodeName, "User");
AD.Children.Remove(User);
}
catch(COMException cex)
{
Console.WriteLine(cex.Message);
}AD.Close();
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货