我需要使用Active Directory对我网站上的用户进行身份验证。我们的开发小组告诉我使用这样的代码:
using System.DirectoryServices.ActiveDirectory;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
LdapAuthentication objAuthenticate;
我能够将DirectoryServices.dll添加到我的bin目录中,并将程序集添加到我的web.config中,但LdapAuthentication类型不在System.Directory.ActiveDirectory中。它说无法找到类型或命名空间名称'LdapAuthentication'...谁能告诉我我做错了什么?感谢。
答案 0 :(得分:1)
为什么你认为应该在那里? LdapAuthentication不是.Net框架中可用的类型。然而,我确实遇到了他们描述构建这样一个类的this howto page。