如题
解决方案 »
- IIS 安装不了 在线等待~
- DataList
- 引用UserControl时,如何才能让他显示基本结构?
- 数字报纸是否有专业的系统?还是就是各自打造了CMS平台?每一家数字报纸的相似度很高啊
- 父子页面之间的传值问题
- 给datagrid添加右键菜单
- 如何将CSV文件导入SQL数据库??急!
- 把vs.net2002卸载后,装上vs.net2003后问题?
- 从数据中读取一段数据,写到文件中??????????????????
- 一页面不同情况接受不同页面用server.transfor传递的数据,怎样判断是哪一父页?
- 我想禁掉页面中嵌套的一个iframe的右键,该怎么做啊???
- DataGrid里数据绑定的问题
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();
}
比较怀疑这个类是调用的api操作注册表。