public void SaveConfig() { var s = new XmlSerializer(Config.GetType()); var f = File.OpenWrite(RootWorkPath + '/' + ConfigMain); f.SetLength(0); s.Serialize(f, Config); f.Close(); }
public void SaveConfig() { XmlSerializer s = new XmlSerializer(config.GetType()); FileStream f = File.OpenWrite(Application.StartupPath + '/' + ConfigMain); f.SetLength(0); s.Serialize(f, config); f.Close(); }
public void LoadConfig() { config = new MainConfig(); if (File.Exists(Application.StartupPath + '/' + ConfigMain)) { XmlSerializer s = new XmlSerializer(config.GetType()); StreamReader r = File.OpenText(Application.StartupPath + '/' + ConfigMain); config = (MainConfig)s.Deserialize(r); r.Close(); } }
public void LoadConfig() { Config = new MainConfig(); if (File.Exists(RootWorkPath + '/' + ConfigMain)) { var s = new XmlSerializer(Config.GetType()); var r = File.OpenText(RootWorkPath + '/' + ConfigMain); Config = (MainConfig)s.Deserialize(r); r.Close(); } }
public void LoadConfig() { config = new MainConfig(); if (File.Exists(Application.StartupPath + '/' + ConfigMain)) { XmlSerializer s = new XmlSerializer(config.GetType()); StreamReader r = File.OpenText(Application.StartupPath + '/' + ConfigMain); config = (MainConfig)s.Deserialize(r); r.Close(); } }
public void LoadConfig() { Config = new MainConfig(); if (File.Exists(RootWorkPath + '/' + ConfigMain)) { var s = new XmlSerializer(Config.GetType()); var r = File.OpenText(RootWorkPath + '/' + ConfigMain); Config = (MainConfig)s.Deserialize(r); Config.ServerHost = GlobalConst.LobbyServerHost; Config.ServerPort = GlobalConst.LobbyServerPort; r.Close(); } }
public void LoadConfig() { Config = new MainConfig(); if (File.Exists(RootWorkPath + '/' + ConfigMain)) { var s = new XmlSerializer(Config.GetType()); var r = File.OpenText(RootWorkPath + '/' + ConfigMain); Config = (MainConfig)s.Deserialize(r); Config.ServerHost = GlobalConst.LobbyServerHost; Config.ServerPort = GlobalConst.LobbyServerPort; r.Close(); } }
public void LoadConfig() { config = new MainConfig(); if (File.Exists(Program.WorkPath + '/' + ConfigMain)) { var s = new XmlSerializer(config.GetType()); var r = File.OpenText(Program.WorkPath + '/' + ConfigMain); config = (MainConfig) s.Deserialize(r); r.Close(); } }