[ValidateAntiForgeryToken] [HttpPost] public ActionResult MyInfo(FormCollection form) { var _admin = adminManager.Find(Session["Accounts"].ToString()); if (_admin.Password != form["Password"]) { _admin.Password = Security.SHA256(form["Password"]); var _resp = adminManager.ChangePassword(_admin.AdministratorID, _admin.Password); if(_resp.Code ==1) ViewBag.Message = "<div class=https://www.jb51.net/article/\"alert alert-success\" role=https://www.jb51.net/article/\"alert\"><span class=https://www.jb51.net/article/\"glyphicon glyphicon-ok\"></span>修改密码成功!</div>"; else ViewBag.Message = "<div class=https://www.jb51.net/article/\"alert alert-danger\" role=https://www.jb51.net/article/\"alert\"><span class=https://www.jb51.net/article/\"glyphicon glyphicon-remove\"></span>修改密码失败!</div>"; } return View(_admin); }
==========================================================
管理员功能到此写完。感慨一下:时间太少,熬夜到凌晨真不容易!
代码见:https://ninesky.codeplex.com/SourceControl/latest
代码下载:https://ninesky.codeplex.com 点击SOURCE CODE 点击Download下载源文件。