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");
当我重新打开应用程序时,我得到一个空白文本