设为首页 加入收藏

TOP

C# 如何进行LDAP用户校验?
2014-11-23 22:10:16 来源: 作者: 【 】 浏览:2
Tags:如何 进行 LDAP 用户 校验

示例代码如下:


private bool Authenticate(string userName, string password, string domain)


{


bool authentic = false;


try


{


DirectoryEntry entry = new DirectoryEntry(“LDAP://”+domain, userName, password);


object nativeObject = entry.NativeObject;


authentic = true;


}


catch (DirectoryServicesCOMException) { }


return authentic;


}


】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇百度——校园招聘 下一篇创今凯达面试题

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容: