.net asp mvc 如何从后端返回数据对象

今天在做项目时,有一个需求:获取从控制器返回的数组对象,方法如下

public ActionResult GetAllFiles()
        {
            string dir = Server.MapPath("../Upload/InterpAct_xlsx");
            string[] files = Directory.GetFiles(dir);
            return Json(files, JsonRequestBehavior.AllowGet);
        }
原文地址:https://www.cnblogs.com/zhengwei-cq/p/7428526.html