다음을 통해 공유


SectionInformation.GetParentSection 메서드

정의

이 개체와 연결된 구성 섹션이 포함된 구성 섹션을 가져옵니다.

public:
 System::Configuration::ConfigurationSection ^ GetParentSection();
public System.Configuration.ConfigurationSection GetParentSection();
member this.GetParentSection : unit -> System.Configuration.ConfigurationSection
Public Function GetParentSection () As ConfigurationSection

반환

SectionInformation 개체와 ConfigurationSection 연결된 구성 섹션입니다.

예외

메서드는 부모 섹션에서 호출됩니다.

예제

다음 예제에서는 메서드를 사용하는 GetParentSection 방법을 보여줍니다.

static public void GetParentSection()
{
    SectionInformation sInfo = 
        GetSectionInformation();

    ConfigurationSection parentSection =
        sInfo.GetParentSection();

    Console.WriteLine("Parent section : {0}",
        parentSection.SectionInformation.Name);
}
Public Shared Sub GetParentSection() 

    Dim sInfo As SectionInformation = _
    GetSectionInformation()
    
    Dim parentSection _
    As ConfigurationSection = _
    sInfo.GetParentSection()
    
    Console.WriteLine("Parent section : {0}", _
    parentSection.SectionInformation.Name)

End Sub

설명

ConfigurationSection 개체에 부모 섹션이 없으면 메서드는 GetParentSection 속성과 동일한 값을 반환합니다 Name .

적용 대상