public override void Load(string path, SettingNode settingNode) { try { string data; settingNode.Clear(); using (StreamReader sr = new StreamReader(new FileStream(path, FileMode.OpenOrCreate, FileAccess.Read), Encoding.UTF8)) { data = sr.ReadToEnd(); } LoadINI(data, settingNode); } catch (SettingException e) { throw new SettingException(Resources.ERR_LOAD, e); } }
public override void Load(string path, SettingNode settingNode) { try { string data; settingNode.Clear(); using (StreamReader sr = new StreamReader(new FileStream(path, FileMode.OpenOrCreate, FileAccess.Read), Encoding.UTF8)) { data = sr.ReadToEnd(); } JObject j = data == "" ? new JObject() : JObject.Parse(data); LoadJson(j, settingNode); } catch (Exception e) { throw new SettingException(Resources.ERR_LOAD, e); } }