Configuration.GetSection 메서드

정의

구성 섹션을 반환합니다.

오버로드

GetSection(String)

지정된 섹션 경로를 사용하여 구성 섹션을 반환합니다.

GetSection(String, String)

지정된 섹션 및 위치 경로를 사용하여 구성 섹션을 반환합니다.

GetSection(String, Type)

지정된 섹션 경로를 사용하여 강력한 형식의 구성 섹션을 반환합니다.

GetSection(String, Type, String)

지정된 섹션 및 위치 경로를 사용하여 강력한 형식의 구성 섹션을 반환합니다.

GetSection(String)

지정된 섹션 경로를 사용하여 구성 섹션을 반환합니다.

public:
 Microsoft::Web::Administration::ConfigurationSection ^ GetSection(System::String ^ sectionPath);
public Microsoft.Web.Administration.ConfigurationSection GetSection (string sectionPath);
member this.GetSection : string -> Microsoft.Web.Administration.ConfigurationSection
Public Function GetSection (sectionPath As String) As ConfigurationSection

매개 변수

sectionPath
String

반환할 섹션의 경로입니다.

반환

ConfigurationSection 개체

예제

다음 예제에서는 섹션을 <moduleProviders> 가져오고 섹션에 각 요소의 이름을 표시합니다.

public void GetGetSection(ServerManager manager)
{
    Configuration config = manager.GetAdministrationConfiguration();
    ConfigurationSection configSection = config.GetSection("moduleProviders");
    ConfigurationElementCollection elementCollection =
        configSection.GetCollection();
    Console.WriteLine("There are " + elementCollection.Count.ToString() +
        " elements in the section.");
    foreach (ConfigurationElement element in elementCollection)
    {
        Console.WriteLine("\t {0}", element.Attributes["name"].Value);
    }
}

설명

구성 설정은 편의를 위해 유사한 설정을 함께 그룹화한 섹션에 포함되어 있습니다. GetSection(String) 오버로드는 해당 경로를 사용하여 구성 섹션을 검색합니다.

적용 대상

GetSection(String, String)

지정된 섹션 및 위치 경로를 사용하여 구성 섹션을 반환합니다.

public:
 Microsoft::Web::Administration::ConfigurationSection ^ GetSection(System::String ^ sectionPath, System::String ^ locationPath);
public Microsoft.Web.Administration.ConfigurationSection GetSection (string sectionPath, string locationPath);
member this.GetSection : string * string -> Microsoft.Web.Administration.ConfigurationSection
Public Function GetSection (sectionPath As String, locationPath As String) As ConfigurationSection

매개 변수

sectionPath
String

반환할 섹션의 경로입니다.

locationPath
String

섹션을 검색할 위치입니다.

반환

ConfigurationSection 개체

설명

GetSection(String, String) 오버로드는 지정된 위치에서 구성 섹션을 검색합니다.

적용 대상

GetSection(String, Type)

지정된 섹션 경로를 사용하여 강력한 형식의 구성 섹션을 반환합니다.

public:
 Microsoft::Web::Administration::ConfigurationSection ^ GetSection(System::String ^ sectionPath, Type ^ type);
public Microsoft.Web.Administration.ConfigurationSection GetSection (string sectionPath, Type type);
member this.GetSection : string * Type -> Microsoft.Web.Administration.ConfigurationSection

매개 변수

sectionPath
String

반환할 섹션의 경로입니다.

type
Type

섹션을 나타내는 .NET Framework 형식입니다.

반환

ConfigurationSection 개체

설명

GetSection(String, Type) 오버로드는 지정된 섹션 경로에 강력한 형식의 구성 섹션을 반환합니다.

적용 대상

GetSection(String, Type, String)

지정된 섹션 및 위치 경로를 사용하여 강력한 형식의 구성 섹션을 반환합니다.

public:
 Microsoft::Web::Administration::ConfigurationSection ^ GetSection(System::String ^ sectionPath, Type ^ type, System::String ^ locationPath);
public Microsoft.Web.Administration.ConfigurationSection GetSection (string sectionPath, Type type, string locationPath);
member this.GetSection : string * Type * string -> Microsoft.Web.Administration.ConfigurationSection

매개 변수

sectionPath
String

반환할 섹션의 경로입니다.

type
Type

섹션을 나타내는 .NET Framework 형식

locationPath
String

섹션을 검색할 위치입니다.

반환

ConfigurationSection 개체

설명

GetSection(String, Type, String) 오버로드는 지정된 위치 및 섹션 경로에 강력한 형식의 구성 섹션을 반환합니다.

적용 대상