C#如何进行LDAP用户校验
2023-07-06
示例代码如下:
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;