System.Configuration.ConfigurationManager.AppSettings [ "キー"]とSystem.Configuration.ConfigurationSettings.AppSettings [ "キー"]の主な違いは何ですか?違い
違い
答えて
ConfigurationSettings.AppSettingsは廃止されました。 ConfigurationManager.AppSettingsが代わりになります。
時にはそれが
http://msdn.microsoft.com/en-en/library/system.configuration.configurationsettings(v=vs.80).aspx
は、ランタイムのバージョンに設定セクションと共通の構成設定を読み取るための1.0および1.1サポートを提供します...ドキュメントを読むことをお勧めします。
つまり、ConfigurationSettingsクラスは非推奨です。
のConfigurationManagerはのAppSettingとのConnectionStringセクションにアクセスすることができます
1のConfigurationManager下記のリストなどにConfigurationSettingsよりも機能してい
2.のConfigurationManagerは、あなたが読んで設定を書き込むために使用できる機能を提供します。あなたはhttp://msdn.microsoft.com/En-US/library/system.configuration.configurationmanager.aspx
'System.Configuration.ConfigurationSettings.AppSettings' を参照してくださいMSDN
上で見ることができることを
3.ユーザーレベル
4の許可によって......、もう一方は廃止されました:廃止とは、古くなった、または使用されなくなったことを意味します。 System.Configuration!System.Configuration.ConfigurationManager.AppSettings '
名前空間が同じでも、ConfigurationManagerオブジェクトが別の(DLL)アセンブリに存在することに注意してください。
のConfigurationManager 名前空間:System.Configuration アセンブリ:System.Configuration(System.Configuration.dll中)
にConfigurationSettings 名前空間:System.Configuration アセンブリ:(System.dllの中に)システム
Anton
http://www.philosophicalgeek.com/2007/11/26/difference-between-configurationsettings-and-configurationmanager/ –
@HariGillalaこれを回答にすることができます。 –