C#-输入字符串中的LDAP身份验证格式不正确
我正在尝试通过C#中的LDAP对用户进行身份验证。每次尝试登录时,都会出现“输入字符串格式不正确”错误 这是我的连接字符串:C#-输入字符串中的LDAP身份验证格式不正确,c#,authentication,ldap,C#,Authentication,Ldap,我正在尝试通过C#中的LDAP对用户进行身份验证。每次尝试登录时,都会出现“输入字符串格式不正确”错误 这是我的连接字符串: <connectionStrings> <add name="MyConnectionString" connectionString="LDAP://123.193.111.22:389.local" /> </connectionStrings> <system.web> <roleMana
<connectionStrings>
<add name="MyConnectionString" connectionString="LDAP://123.193.111.22:389.local" />
</connectionStrings>
<system.web>
<roleManager enabled="true" />
<membership defaultProvider="MyMembershipProvider"><providers>
<add name="MyMembershipProvider"
connectionStringName="MyConnectionString"
type="System.Web.Security.ActiveDirectoryMembershipProvider,
System.Web, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a"
connectionUsername="MyUsername"
connectionPassword="MyPassword"
connectionProtection="Secure"
enableSearchMethods="true" />
</providers>
</membership>
<trust level="Full" />
</system.web>
<authentication mode="Forms">
<forms name=".ADAuthCookie" loginUrl="~/Admin/Login"
timeout="450" slidingExpiration="false" protection="All"/>
</authentication>
错误似乎在类型=“System.Web.Security.ActiveDirectoryMembershipProvider。如有任何建议,将不胜感激。谢谢 我已经设法弄明白了。必须修改会员资格提供商代码,现在我可以验证用户身份。为什么要将
元素包装在
元素中?哦,对不起,我复制粘贴代码时一定是把它弄糟了。源代码中没有。您确定可以使用ldap://123.193.111.22:389.local这样的ldap url吗?您已经尝试过LDAP://123.193.111.22.local:389了吗?我已经尝试过了,不断出现“无法与服务器建立安全连接”错误。但这看起来像是另一个问题。。。