将来の使用のために、構成ファイルにいくつかの設定を保存したいと考えています。すべてのチュートリアルで見られる通常のコードを使用しようとしています -
Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
config.AppSettings.Settings["username"].Value = m_strUserName;
// I also tried -
//config.AppSettings.Settings.Remove("username");
//config.AppSettings.Settings.Add("username", m_strUserName);
config.Save(ConfigurationSaveMode.Modified);
ConfigurationManager.RefreshSection("appSettings");
今-実行時に確認できます-「デバッグ」フォルダーのファイル「...vshost.exe.config」が変更され、アプリケーションを閉じるとナット-すべての変更が削除されます。私に何ができる?