【问题标题】:What's the connection string for LDAP?LDAP 的连接字符串是什么?
【发布时间】:2011-03-19 02:50:05
【问题描述】:

这里我需要如何使用它:

string tmpDirectory = String.Format("LDAP://ou={0},dc={1},dc={2}", 
                                    parentOrganizationUnit,
                                    domainName,
                                    domainExtension
);

当我尝试使用此连接运行某些代码时,出现异常。 (See this question for more information)。

我被告知我需要提供带有凭据的连接字符串 - 用户名和密码。

连接字符串是什么样的?我需要确切的语法。 :) 谢谢!

我使用的是 Windows Server 2003 和 Active Directory。

【问题讨论】:

    标签: c# active-directory ldap directoryservices


    【解决方案1】:

    凭据不进入连接字符串,而是another overload of the DirectoryEntry constructor 上的单独参数:

    var entry = new DirectoryEntry(tmpDirectory, "username", "password");
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2010-09-21
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多