image

编辑人: 浅唱

calendar2025-05-12

message2

visits806

C# 如何进行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;

}

喵呜刷题:让学习像火箭一样快速,快来微信扫码,体验免费刷题服务,开启你的学习加速器!

创作类型:
原创

本文链接:C# 如何进行LDAP用户校验?

版权声明:本站点所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明文章出处。
分享文章
share