public void GetSettings() { try { JSONReader reader = new JSONReader(SettingsPath); Value = reader.ReadJSON <JObject>(); } catch (IOException ex)//捕获FileNotFoundException和DirectoryNotFoundException(参见JSONReader类中的异常类型)a { PostEvent(new SettingsNotFoundEventArgs("找不到配置文件,将重新生成配置")); Value = new JObject();//返回空对象 } }