如题

解决方案 »

  1.   

    windows用户,估计都存放在注册表里面吧,楼下的来解释.
      

  2.   

    // RemoveUserFromGroup - Removes user from a specified group
    static public void RemoveUserFromGroup (string username, string groupName)
    {
    // First, get a DE for the user
    DirectoryEntry userContainerDE =
    new DirectoryEntry (usersLdapPath, adLoginName, adLoginPassword);
    DirectorySearcher ds = new DirectorySearcher (userContainerDE);
    ds.Filter = "(sAMAccountName=" + username + ")";
    ds.PropertiesToLoad.Add ("cn");
    SearchResult r = ds.FindOne();
    DirectoryEntry theUserDE = new DirectoryEntry (r.Path, adLoginName, adLoginPassword);// Now get a DE for the group
    ds.Filter = "(cn=" + groupName + ")";
    r = ds.FindOne();
    DirectoryEntry theGroupDE = new DirectoryEntry (r.Path, adLoginName, adLoginPassword);// Next we extract the user path from the LDAP string
    string userPath = theUserDE.Path;
    userPath = userPath.Substring (userPath.IndexOf("CN="));// Now add the user to the group
    theGroupDE.Properties["member"].Remove (userPath);
    theGroupDE.CommitChanges();
    }
      

  3.   

    http://groups.google.com/group/microsoft.public.adsi.general/browse_thread/thread/32b5a63166b5e41d/3c06df48995af3f8?lnk=st&q=Machine+Account+delete+user+asp.net+c%23&rnum=4&hl=zh-CN#3c06df48995af3f8
      

  4.   

    webconfig中,<deny user=""/>
      

  5.   

    DirectoryEntry 
    比较怀疑这个类是调用的api操作注册表。