ConfigurationSettings.GetConfig(String) 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
警告
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) 方法。
適用於
另請參閱
意見反應
https://aka.ms/ContentUserFeedback。
即將登場:在 2024 年,我們將逐步淘汰 GitHub 問題作為內容的意見反應機制,並將它取代為新的意見反應系統。 如需詳細資訊,請參閱:提交並檢視相關的意見反應