Properties.Settings.Default.Save()の保存場所

Properties.Settings.Default.Save()の保存場所は、c:\ユーザー\「ユーザー名」\AppData\Local\アプリ名の下に各バージョンごとに保存されます。
例としてLLM_Doghouseの色やウィンドウの位置などは画像のように保存されています。LLM_Doghouseの古いバーションの設定値はいらないので消しても問題ないです。


バージョンアップすると設定が元に戻ってしまうのはバージョンごとに保存されているからです。

ちなみに保存しているコードはこんな感じ。

        private void WindowSaveSetting()
        {
            try
            {
                    if (WindowState == WindowState.Maximized)
                    {
                        Properties.Settings.Default.Top = RestoreBounds.Top;
                        Properties.Settings.Default.Left = RestoreBounds.Left;
                        Properties.Settings.Default.Height = RestoreBounds.Height;
                        Properties.Settings.Default.Width = RestoreBounds.Width;
                        Properties.Settings.Default.Maximized = true;
                    }
                    else
                    {
                        Properties.Settings.Default.Top = this.Top;
                        Properties.Settings.Default.Left = this.Left;
                        Properties.Settings.Default.Height = this.Height;
                        Properties.Settings.Default.Width = this.Width;
                        Properties.Settings.Default.Maximized = false;
                    }
                    Properties.Settings.Default.Save();
              }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, this.Title, MessageBoxButton.OK, MessageBoxImage.Error);
            }
        }

Follow me!

コメントを残す

メールアドレスが公開されることはありません。 が付いている欄は必須項目です