ConfigurationSection.GetSection(String) Method

Definition

取得具有指定索引鍵的組態子區段。Gets a configuration sub-section with the specified key.

public:
 virtual Microsoft::Extensions::Configuration::IConfigurationSection ^ GetSection(System::String ^ key);
public Microsoft.Extensions.Configuration.IConfigurationSection GetSection (string key);
abstract member GetSection : string -> Microsoft.Extensions.Configuration.IConfigurationSection
override this.GetSection : string -> Microsoft.Extensions.Configuration.IConfigurationSection
Public Function GetSection (key As String) As IConfigurationSection

Parameters

key
String

組態區段的索引鍵。The key of the configuration section.

Returns

IConfigurationSection

IConfigurationSectionThe IConfigurationSection.

Implements

Remarks

這個方法永遠不會傳回 nullThis method will never return null. 如果找不到具有指定索引鍵的相符子區段,將會傳回空的 IConfigurationSectionIf no matching sub-section is found with the specified key, an empty IConfigurationSection will be returned.

Applies to