Beispiel #1
0
        public ActionResult Del(string userName)
        {
            RtxUserManager rum = new RtxUserManager();

            if (rum.RemoveUser(userName))
            {
                return(Json(new AjaxResult {
                    Status = "ok", Msg = "删除成功", Data = userName
                }));
            }
            return(Json(new AjaxResult {
                Status = "error", Msg = "删除失败"
            }));
        }
        public ActionResult DelUser(string userName)
        {
            string         filePath  = Server.MapPath("~/ADConfig.xml");
            AdOperate      ado       = new AdOperate(filePath);
            DirectoryEntry entry     = ado.GetEntry();
            DirectoryEntry userEntry = ado.GetUserEntry(entry, userName);

            ado.DelEntry(userEntry);
            RtxUserManager rum = new RtxUserManager();

            rum.RemoveUser(userName);
            return(Json(new AjaxResult {
                Status = "ok", Msg = "用户删除成功"
            }));
        }