2
爲什麼當AD中的策略設置爲三次嘗試時,一次不成功嘗試後,以下代碼鎖定帳戶?有沒有更好的方式來檢查憑據編程與AD。活動目錄 - 以編程方式檢查提供的憑據
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;
}
當輸入了正確的憑據做工精細...
感謝,