System.Configuration.Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
config.AppSettings.Settings["dbHost"].Value = txtHost.Text.ToString();
config.AppSettings.Settings["dbName"].Value = txtName.Text.ToString();
config.AppSettings.Settings["dbUser"].Value = txtUser.Text.ToString();
config.AppSettings.Settings["dbPass"].Value = txtPass.Text.ToString();
config.Save(ConfigurationSaveMode.Modified);
ConfigurationManager.RefreshSection("appSettings");
アプリケーションを再度開くと、空白のテキストが表示されます