using EXAM.Models; using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; namespace EXAM.Controllers { public class HomeController : Controller { public ActionResult Index() { ViewBag.Title = "Home Page"; return View(); } public ActionResult LoginTeacher(Teacher t) { ViewBag.Title = "自动考试系统 教师登陆"; return View(t); } public ActionResult LoginStudent(Student stu) { ViewBag.Title = "自动考试系统 学生登陆"; return View(stu); } public string LoginGetCode() { return Session["Code"].ToString(); } public ActionResult Logout() { Session.Clear(); return RedirectToAction("Index"); } /// <summary> /// 关于界面 /// </summary> /// <returns></returns> public ActionResult About() { return View(); } public ActionResult My() { return View(); } [HttpPost] public ActionResult My(HttpPostedFileBase file) { if (file.ContentLength!=0&&file!=null) { file.SaveAs(Server.MapPath("~/Img/") +file.FileName); } return View(); } } }