【发布时间】:2009-07-29 02:31:06
【问题描述】:
假设您已使用简单语法连接到 Active Directory:
string adPath = "LDAP://server.domain.com/CN=John,CN=Users,dc=domain,dc=com";
DirectoryEntry userEntry = Settings.GetADEntry(adPath);
现在,您发现您希望查看该用户的属性。 让我们尝试显示邮件属性(代表电子邮件地址):
Console.WriteLine("User's mail attribute is " + userEntry.Properties["mail"]);
如何删除邮件属性值,因为将其设置为空字符串不会引发错误?
【问题讨论】:
标签: c# active-directory