public ActionResult SaveMenu(string menu) { ///记录调用次数 var logPath = Server.MapPath(string.Format("~/App_Data/MP/{0}/", DateTime.Now.ToString("yyyy-MM-dd"))); if (!Directory.Exists(logPath)) { Directory.CreateDirectory(logPath); } using (StreamWriter sw = new StreamWriter(logPath + "savemenu.txt", true, Encoding.UTF8)) { sw.WriteLine("调用一次"); } return(Content(CustomMenu.CreatMenu(menu))); }