Unknown Error:(0x80005000)
/// <summary> /// Interaction logic for MainWindow.xaml /// </summary> public partial class Login : Window { public Login() { InitializeComponent(); AddData adminScreen = new AddData(); string username = textBoxUsername.Text; string password = Convert.ToString(passwordBox.Password); DirectoryEntry entry = new DirectoryEntry("LDAP://corporate.adcorp.com/xyz.com/dc=xyz,dc=com", username, password); try { Object obj = entry.NativeObject; DirectorySearcher search = new DirectorySearcher(entry); search.Filter = ("(sAMAccountName=" + username + ")"); search.PropertiesToLoad.Add("cn"); SearchResult result = search.FindOne(); if (result != null) { adminScreen.Show(); this.Close(); } } catch(Exception ex) { MessageBox.Show(ex.Message.ToString()); } } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)