user = this.MainLogin.UserName.ToUpper(); pass = this.MainLogin.Password; domain = "gruposcare"; path = "LDAP://gcsbog-dc00.gruposcare.org.co"; string domainAndUsername = domain + @"\" + user; DirectoryEntry entry = new DirectoryEntry(path, domainAndUsername, pass); try { DirectorySearcher search = new DirectorySearcher(entry); SearchResult result = search.FindOne(); if (result == null) { //Authentication Failed } else { //Authentication Right } } catch (Exception ex) { return false; }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)