ConfigurationSettings.GetConfig(String) Metod

Definition

Varning

ConfigurationSettings.GetConfig has been deprecated. Use System.Configuration.ConfigurationManager.GetSection instead.

Varning

This method is obsolete, it has been replaced by System.Configuration!System.Configuration.ConfigurationManager.GetSection

Returnerar objektet ConfigurationSection för det angivna konfigurationsavsnittets namn och sökväg.

public:
 static System::Object ^ GetConfig(System::String ^ sectionName);
[System.Obsolete("ConfigurationSettings.GetConfig has been deprecated. Use System.Configuration.ConfigurationManager.GetSection instead.")]
public static object GetConfig(string sectionName);
public static object GetConfig(string sectionName);
[System.Obsolete("This method is obsolete, it has been replaced by System.Configuration!System.Configuration.ConfigurationManager.GetSection")]
public static object GetConfig(string sectionName);
[<System.Obsolete("ConfigurationSettings.GetConfig has been deprecated. Use System.Configuration.ConfigurationManager.GetSection instead.")>]
static member GetConfig : string -> obj
static member GetConfig : string -> obj
[<System.Obsolete("This method is obsolete, it has been replaced by System.Configuration!System.Configuration.ConfigurationManager.GetSection")>]
static member GetConfig : string -> obj
Public Shared Function GetConfig (sectionName As String) As Object

Parametrar

sectionName
String

Ett konfigurationsnamn och en sökväg, till exempel "system.net/settings".

Returer

Objektet ConfigurationSection för det angivna konfigurationsavsnittets namn och sökväg.

Attribut

Undantag

Det gick inte att hämta det begärda avsnittet.

Kommentarer

Den här metoden är föråldrad och underhålls för bakåtkompatibilitet. Använd ConfigurationManager.GetSection(String) metoden i stället.

Gäller för

Se även