Unterschied zwischen ConfigurationManager und ConfigurationSettings
Was ist der Unterschied zwischen System.- Konfiguration.ConfigurationManager.AppSettings["key"] und System.- Konfiguration.ConfigurationSettings.AppSettings["key"] ?
InformationsquelleAutor Karthick | 2012-09-11
Du musst angemeldet sein, um einen Kommentar abzugeben.
ConfigurationManager mehr funktional als ConfigurationSettings als Liste unten
1. ConfigurationManager zugreifen können " appsetting und connectionstring Abschnitt
2. ConfigurationManager bieten-Funktion, die Sie verwenden können, um Lesen und schreiben von config.
3. Berechtigung von Benutzer-Ebene
4. ...... und andere, die Sie kann finden Sie auf der msdn-Website
Finden http://msdn.microsoft.com/En-US/library/system.configuration.configurationmanager.aspx
InformationsquelleAutor user1662586
ConfigurationSettings.AppSettings ist veraltet. ConfigurationManager.AppSettings ist der Ersatz.
Eine mögliche Antwort wird im link @Hari Gillala geschrieben als Kommentar zu Ihrer Frage.
ja hab es, danke.. @Christian.K
gibt es keine Differenz zum verarbeiten einer Konfigurationsdatei?
InformationsquelleAutor Christian.K
Beachten Sie, dass die ConfigurationManager-Objekt in einer anderen (DLL) Montage auch wenn der namespace ist die gleiche.
ConfigurationManager
Namespace: System.Konfiguration
Assembly: System.Konfiguration (in System.Configuration.dll)
ConfigurationSettings
Namespace: System.Konfiguration
Assembly: System (in System.dll)
Anton
InformationsquelleAutor Anton Ochss
Manchmal ist es eine gute Idee zu Lesen, die docs..
http://msdn.microsoft.com/en-en/library/system.configuration.configurationsettings(v=vs. 80).aspx
Bietet runtime-Versionen 1.0 und 1.1 die Unterstützung zum Lesen von Konfigurations-Sektionen und Allgemeine Konfigurationseinstellungen.
In anderen Worten, ConfigurationSettings-Klasse ist veraltet.
InformationsquelleAutor Oscar
‘- System.- Konfiguration.ConfigurationSettings.AppSettings' ist obsolet: Veraltet alt oder nicht mehr in Gebrauch. Es wurde ersetzt durch das System.Konfiguration!System.- Konfiguration.ConfigurationManager.AppSettings'
InformationsquelleAutor Rajesh Pathakoti