public void getConfig(string pathConfig = null, string pathNames = null, string projectName = null) { string path; if (pathConfig == null && pathNames == null && projectName == null) { path = Path.PhysicalPath + @"\JSONconfig\" + Session["ProjectName"].ToString() + "_" + Session["pathConfig"].ToString().Substring(Session["pathConfig"].ToString().LastIndexOf(@"\") + 1) + ".json"; } else { path = Path.PhysicalPath + @"\JSONconfig\" + projectName + "_" + pathConfig.Substring(pathConfig.LastIndexOf(@"\") + 1) + ".json"; } string json; if (System.IO.File.Exists(path)) { json = System.IO.File.ReadAllText(path); json = new string((from c in json where !char.IsWhiteSpace(c) || c.ToString().Contains(" ") select c).ToArray()); int jsonLength = json.Length; configSer = new JavaScriptSerializer().Deserialize <Config>(json); config.LangEnbList = configSer.LangEnbList; config.NameDefList = configSer.NameDef; config.TableDefList = configSer.TableDef; config.TextlistDefList = configSer.TextlistDef; } else { if (config.ViewList.Count == 0) { if (Session != null) { pathConfig = Session["pathConfig"].ToString(); pathNames = Session["pathNames"].ToString(); } Iniparser ini = new Iniparser(pathConfig, pathNames); ini.ParseLangs(config); ini.ParseNames(config, Const.separators); ini.ParseCfg(config, Const.separators, config); Iniparser.FindTableName(config); //Only to find missing(all are missing) tableName } json = config.toJSON(config); Directory.CreateDirectory(Path.PhysicalPath + @"\JSONconfig"); System.IO.File.WriteAllText(path, json); } if (pathConfig == null && pathNames == null && projectName == null) { Response.ContentType = "application /json"; Response.Write(json); } }