ConfigurationSettings.GetConfig(String) 方法

定義

警告

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

警告

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

傳回所傳遞之組態區段名稱和路徑的 ConfigurationSection 物件。

public:
 static System::Object ^ GetConfig(System::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.")]
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")>]
static member GetConfig : string -> obj
[<System.Obsolete("ConfigurationSettings.GetConfig has been deprecated. Use System.Configuration.ConfigurationManager.GetSection instead.")>]
static member GetConfig : string -> obj
static member GetConfig : string -> obj
Public Shared Function GetConfig (sectionName As String) As Object

參數

sectionName
String

組態名稱和路徑,例如 "system.net/settings".

傳回

所傳遞之組態區段名稱和路徑的 ConfigurationSection 物件。

屬性

例外狀況

無法擷取要求的區段。

備註

這個方法已過時,而且會維護回溯相容性。 請改用 ConfigurationManager.GetSection(String) 方法。

適用於

另請參閱