private void LoadConfig() 
        {
            ADPATH = System.Configuration.ConfigurationManager.AppSettings["LDAPPath"].ToString();
            ADUSER = System.Configuration.ConfigurationManager.AppSettings["LDAPUser"].ToString();
            ADPWD = System.Configuration.ConfigurationManager.AppSettings["LDAPPassword"].ToString();
            det = new DirectoryEntry(ADPATH, ADUSER, ADPWD, AuthenticationTypes.Secure);         }        private void Seach()
        {
            try
            {
                DirectorySearcher ds = new DirectorySearcher(det);
                ds.Filter = "(&(objectClass=user)(mail=" + tbxUserName.Text + "))";
                SearchResult results = ds.FindOne();
                if (results != null)
                {
                    DirectoryEntry user = results.GetDirectoryEntry();
                    //[email protected]
                    
                    user.Properties["mail"][0] = "[email protected]";  //我在这里修改了Email
                    
                    //这里显示的也是修改过得,可是当我屏蔽上面的代码,再次查询的时候Email还是未修改过得Email
                    MessageBox.Show(user.Properties["mail"][0].ToString());  
                    
                    det.CommitChanges();
                    det.Close();
                    user.Close();
                }
            }
            catch (Exception ex)
            { MessageBox.Show(ex.Message); }
        }