ConfigurationSettings.GetConfig(String) 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
警告
ConfigurationSettings.GetConfig has been deprecated. Use System.Configuration.ConfigurationManager.GetSection instead.
警告
This method is obsolete, it has been replaced by System.Configuration!System.Configuration.ConfigurationManager.GetSection
回傳 ConfigurationSection 已傳遞的設定區段名稱與路徑的物件。
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
參數
- sectionName
- String
一個配置名稱和路徑,例如「system.net/settings」。
傳回
傳遞的設定區段名稱與路徑的 ConfigurationSection 物件。
- 屬性
例外狀況
無法取得所要求的區段。
備註
此方法已過時,並保留以維持向下相容性。 請用這個 ConfigurationManager.GetSection(String) 方法。