public IActionResult Index() { ViewData["Nav"] = base.LoadNav("MyConfig"); MyConfig myConfig1 = jsonFileHelper.Read <MyConfig>(); return(View(myConfig1)); }
/// <summary> /// 读取配置文件信息 /// </summary> /// <returns></returns> public static OrleansConfig ReadConfig() { //读取配置文件路径 var file = Path.Combine(Strings.AppDomainPath, "config/OrleansServer.json"); if (File.Exists(file)) {//文件存在,读取配置信息 var jsonFileHelper = new JsonFileHelper(file); return(jsonFileHelper.Read <OrleansConfig>("Orleans")); } throw new FileNotFoundException("OrleansServer.json不存在" + file); }