SectionInformation.AllowOverride 속성

정의

연결된 구성 섹션을 하위 수준 구성 파일로 재정의할 수 있는지 여부를 나타내는 값을 가져오거나 설정합니다.

public:
 property bool AllowOverride { bool get(); void set(bool value); };
public bool AllowOverride { get; set; }
member this.AllowOverride : bool with get, set
Public Property AllowOverride As Boolean

속성 값

섹션을 재정의할 수 있으면 true이고, 그렇지 않으면 false입니다. 기본값은 false입니다.

예제

이 섹션의 예제에서는 구성 파일의 AllowOverride 관련 섹션 정보에 액세스한 후 속성 값을 가져오는 방법을 보여 줍니다.

다음 예제에서는 개체를 SectionInformation 가져옵니다.

// Get the current configuration file.
System.Configuration.Configuration config =
        ConfigurationManager.OpenExeConfiguration(
        ConfigurationUserLevel.None);

// Get the section.
UrlsSection section =
    (UrlsSection)config.GetSection("MyUrls");

SectionInformation sInfo =
    section.SectionInformation;
' Get the current configuration file.
Dim config _
As System.Configuration.Configuration = _
ConfigurationManager.OpenExeConfiguration( _
ConfigurationUserLevel.None)

' Get the section.
Dim section As UrlsSection = _
CType(config.GetSection("MyUrls"), UrlsSection)

Dim sInfo As SectionInformation = _
section.SectionInformation

다음 예제에서는 값을 가져옵니다 AllowOverride .

bool allowOverride =
    sInfo.AllowOverride;
Console.WriteLine("Allow override: {0}",
               allowOverride.ToString());
Dim allowOverride As Boolean = _
sInfo.AllowOverride
Console.WriteLine("Allow override: {0}", _
allowOverride.ToString())

적용 대상