/// <summary> /// 保存设置 /// </summary> public void Save() { try { Serializition.SaveToFile(this, ConfigName); } catch (Exception ex) { throw new Exception(ex.ToString()); } }
public void Save() { try { Serializition.SaveToFile(this, string.Format(@"config\{0}", "Report.config")); } catch (Exception ex) { throw new Exception(ex.ToString()); } }
/// <summary> /// 加载配置 /// </summary> /// <returns></returns> public static ConfigSocketC Load() { try { ConfigSocketC obj = (ConfigSocketC)Serializition.LoadFromFile(typeof(ConfigSocketC), ConfigName); return(obj); } catch (Exception ex) { throw new LoadException(ConfigName, ex.Message); } }