try { LdapConnection connection = new LdapConnection("myserver.mycompany.com"); NetworkCredential credential = new NetworkCredential(textBoxUsername.Text, passwordBox.Password); connection.Credential = credential; connection.Bind(); AddData admin = new AddData(); admin.Show(); this.Close(); } catch (LdapException lexc) { String error = lexc.ServerErrorMessage; MessageBox.Show("User Authentication Failed! Please Try again."); } catch (Exception exc) { MessageBox.Show(Convert.ToString(exc)); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)