C#
string FullConfig = File.ReadAllText(ConfigFile);
FullConfig = FullConfig.Replace("SessionName=\"" + LoadSetting(ConfigFile, "SessionName") + "\"", "SessionName=\"" + serverName.Text + "\"");
FullConfig = FullConfig.Replace("JoinPassword=\"" + LoadSetting(ConfigFile, "JoinPassword") + "\"", "JoinPassword=\"" + serverPass.Text + "\"");
FullConfig = FullConfig.Replace("AdminPassword=\"" + LoadSetting(ConfigFile, "AdminPassword") + "\"", "AdminPassword=\"" + adminPass.Text + "\"");
FullConfig = FullConfig.Replace("MaxPlayers=" + LoadSetting(ConfigFile, "MaxPlayers"), "MaxPlayers=" + maxPlayers.Text);
FullConfig = FullConfig.Replace("ShutdownIfNotJoinedFor=" + LoadSetting(ConfigFile, "ShutdownIfNotJoinedFor"), "ShutdownIfNotJoinedFor=" + shutDownNotJoined1.Text);
FullConfig = FullConfig.Replace("ShutdownIfEmptyFor=" + LoadSetting(ConfigFile, "ShutdownIfEmptyFor"), "ShutdownIfEmptyFor=" + shutdownEmpty.Text);
FullConfig = FullConfig.Replace("ResumeProspect=" + LoadSetting(ConfigFile, "ResumeProspect"), "ResumeProspect=" + GetResumeStatus());
File.WriteAllText(ConfigFile, FullConfig);
string FinalConfig = File.ReadAllText(ConfigFile);
if (displayChanges.IsChecked == true)
{
MessageBox.Show(FinalConfig);
}