public ActionResult AnalyzeFile() { if (Request.Files.Count == 0) { throw new ArgumentException("请选择上传文件"); } var file = HttpContext.Request.Files[0]; var fileName = file.FileName; if (string.IsNullOrEmpty(fileName)) { throw new ArgumentException("请选择上传文件"); } var filePath = FileManager.Upload(file); var list = ExcelManager.AnalyzeConduct(filePath); var dict = list.GroupBy(e => e.ELName).ToDictionary(e => e.Key, e => e.GroupBy(k => k.LandName).ToDictionary(k => k.Key, k => k.ToList())); Core.ConductStandardManager.AddRange(dict, Identity.UserID); return(RedirectToAction("Index")); }