访问json文件, 直接输出总是带有 \ , 很烦, 没去找别的方式, 直接范序列化再按照自己的方式输出
var countryFilePath = HttpContext.Current.Server.MapPath("~/Content/country.json"); using (StreamReader sr = File.OpenText(countryFilePath)) { var json = sr.ReadToEnd(); resultMsg.statue = (int)StatueEnum.Success; var newValue = JsonConvert.DeserializeObject(json); var list=new List (); for (int i = 0, ileng = newValue.Count; i < ileng; i++) { var item = newValue[i]; list.Add(new { code = item["code"].Value, en = item["en"].Value, cn = item["cn"].Value, }); } resultMsg.data = list; }