SectionInformation.AllowLocation 속성

정의

구성 섹션에서 location 특성을 사용할 수 있는지 여부를 나타내는 값을 가져오거나 설정합니다.

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

속성 값

true 특성이 허용되면 location이고, 그렇지 않으면 false입니다. 기본값은 true입니다.

예외

선택한 값이 이미 정의된 값과 충돌하는 경우

예제

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

다음 예제에서는 개체를 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

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

bool allowLocation =
    sInfo.AllowLocation;
Console.WriteLine("Allow location: {0}",
               allowLocation.ToString());
Dim allowLocation As Boolean = _
sInfo.AllowLocation
Console.WriteLine("Allow location: {0}", _
allowLocation.ToString())

설명

false설정하면 속성은 AllowLocation 네이티브 코드 판독기에서 섹션에 액세스한다는 것을 나타냅니다. 따라서 네이티브 코드 판독기는 의 개념을 location지원하지 않으므로 특성을 사용할 location 수 없습니다.

적용 대상