SectionInformation.IsProtected 속성

정의

연결된 구성 섹션이 보호되는지 여부를 나타내는 값을 가져옵니다.

public:
 property bool IsProtected { bool get(); };
public bool IsProtected { get; }
member this.IsProtected : bool
Public ReadOnly Property IsProtected As Boolean

속성 값

ConfigurationSection이 보호되면 true이고, 그렇지 않으면 false입니다. 기본값은 false입니다.

예제

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

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

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

bool protect =
    sInfo.IsProtected;
Console.WriteLine("Section protected?: {0}",
    protect.ToString());
Dim protect As Boolean = _
sInfo.IsProtected
Console.WriteLine("Section protected?: {0}", _
protect.ToString())

설명

보호된 구성 섹션은 암호화되고 읽기 전용입니다.

보호된 구성 섹션에 대한 자세한 내용은 보호된 구성을 사용하여 구성 정보 암호화를 참조하세요.

적용 대상

추가 정보