トップ回答者
アプリケーションの設定情報を読込/保存するとき

質問
-
nrealと申します。初めての質問ですがよろしくお願いします。
http://itpro.nikkeibp.co.jp/article/MAG/20070109/258195/ でアプリケーションの設定情報を読込/保存の方法「プロジェクトのプロパティを開き,設定タブから登録する」を知ったのですが,2つ目(textBox2)でも同じことをしたいのですが,そのとき「名前」を別の名前にして登録すべきなのかどうかを知りたくて質問させていただきました。
名前 型 スコープ 値 textBox1 userID string ユーザー 4 textBox2 ????? string ユーザー 9
private void Form1_Load(object sender, EventArgs e) { string userID = Properties.Settings.Default.UserID; textBox1.Text = userID; } private void Form1_FormClosing(object sender, FormClosingEventArgs e) { string userID = textBox1.Text; Properties.Settings.Default.UserID = userID; Properties.Settings.Default.Save(); }