public void btnlogin_Click(object sender, EventArgs e) { using (DirectoryEntry entry = new DirectoryEntry()) { //Session["username"] = txtusername; entry.Username = txtusername.Text; entry.Password = txtpassword.Text; DirectorySearcher searcher = new DirectorySearcher(entry); searcher.Filter = "(objectclass=user)"; try { searcher.FindOne(); lblrem.Text = "Successfull"; Response.Redirect("Default2.aspx"); } catch (COMException ex) { if (ex.ErrorCode == -2147023570) { lblrem.Text = "Login Failed.Please ensure that your username and password is correct"; } } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)