/// <summary> /// Edits the server configuration. /// </summary> /// <param name="serversPath">The servers path.</param> /// <param name="serverName">Name of the server.</param> /// <param name="gamemode">The gamemode.</param> private void EditServerConfig(string serversPath, string serverName, string gamemode) { Entities.ServerConfig config = new Entities.ServerConfig() { Gamemode0 = gamemode }; string configPath = serversPath + "\\" + serverName + "\\" + serverFiles[3]; File.WriteAllText(configPath, config.ToString()); }
private void Save() { try { Entities.ServerConfig con = new Entities.ServerConfig(); con.Server = cbxLoaiMay.SelectedItem.ToString(); con.Ip = txtIP.Text; con.Port = txtPort.Text; Common.Utilities com = new Common.Utilities(); com.CreateFileServerConfig(con); } catch (Exception ex) { string s = ex.Message; this.Close(); } }
private void Save() { try { Entities.ServerConfig con = new Entities.ServerConfig(); con.Server = cbxLoaiMay.SelectedItem.ToString(); con.Ip = txtIP.Text; con.Port = txtPort.Text; Common.Utilities com = new Common.Utilities(); com.CreateFileServerConfig(con); } catch (Exception ex) { string s = ex.Message; this.Close(); } }