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 AggregateException("请选择上传文件"); } var filePath = FileManager.Upload(file); var list = ExcelManager.AnalyzeEnterprise(filePath); Core.EnterpriseManager.AddRange(list, Identity.UserID); return(RedirectToAction("Index")); }